Give 2 searching algorithms for lists or arrays
Binary
Linear
Binary search requirements
Must have a sorted list
How does a binary search work?
The middle item of a list is first checked
If the item is greater than the node your are looking for, it will loom on the left side, otherwise on the right side.
This process keeps happening untill the searching node becomes a midpoint
How does a liner search work?
Each item is checked against the search item in order (ie iteration, but list order does not matter)
In a list of 2^n items, what will be the maximum items you will have to search for in a binary search?
n+1