Search/Checking algorithms
= an โ๏ธ Algorithm that searches/checks e.g. an ๐ Array (programming)
Types
- โ Existence test: min 1 element matches (โ return on = no match)
- โ Universal test: every element matches (โ return on โ match)
List types
- Unsorted list
- Linear search (start โ end)
- Sorted list
- Binary search
- element_to_check =
(minIndex + maxIndex) / 2
if (element_to_check != target)
โ(newMinIndex + newMaxIndex) / 2
- else โ found
- always round off, stops at first finding
- element_to_check =
- Binary search