Content deleted Content added
Pbsouthwood (talk | contribs) |
fix reference formatting weirdness |
||
Line 6:
}}
[[File:Hash table 3 1 1 0 1 0 0 SP.svg|thumb|upright=1.2|Visual representation of a [[hash table]], a [[data structure]] that allows for fast retrieval of information.]]
In [[computer science]], a '''search algorithm''' is any [[algorithm]] which solves the [[search problem]], namely, to retrieve information stored within some data structure, or calculated in the [[Feasible region|search space]] of a [[problem ___domain]]. Examples of such structures include but are not limited to a [[linked list]], an [[array data structure]], or a [[search tree]]. The appropriate search algorithm often depends on the data structure being searched, and may also include prior knowledge about the data. Searching also encompasses algorithms that query the data structure, such as the SQL SELECT command.{{Sfn|Beame|Fich|2002|p=39}}
Search algorithms can be classified based on their mechanism of searching. [[Linear search]] algorithms check every record for the one associated with a target key in a linear fashion.{{Sfn|Knuth|1998|loc=§6.1 ("Sequential Searching")}}
Search functions are also evaluated on the basis of their complexity, or maximum theoretical run time. Binary search functions, for example, have a maximum complexity of {{math|''O''(log ''n'')}}, or logarithmic time. This means that the maximum number of operations needed to find the search target is a logarithmic function of the size of the search space.
|