C++ Language/Std/CRuntime/BasicAlgorithms/Search

From Wikibooks, open books for an open world
Jump to navigation Jump to search

The C-Runtime's basic implementation of linear search by _lfind() will return NULL if the key does not already exist.

Binary search by bsearch() expects the input to be both sorted and unique.

Additional information about C-Runtime's search functions (includes interactive examples)