Searching algorithms
↑Linear search works without sorted input. Binary search repeatedly halves an indexed sorted range. Compare preconditions, time complexity and memory before choosing either algorithm.
Lessons and practical examples
Section titled “Lessons and practical examples”-
Binary search: Step through binary search on a sorted array.
-
Linear search: Search an unsorted collection one value at a time.
How to study this section
Section titled “How to study this section”Start with one concept, work through a small example, and verify your prediction. Follow linked topics when a prerequisite or related idea needs more explanation.
