Searching means finding where a value is — or proving it isn't there. Looking up a contact, checking whether a username is taken, finding the first log line after midnight: all searches. There are two basic ways to do it, and the gap between them is one of the biggest in all of computing.
Other structures are built for searching too: a hash table finds a key in O(1) on average (Hashing course), a binary search tree in O(log n) while staying sorted as values come and go (Binary Search Tree course), and BFS and DFS search graphs (Graph course). This course is about searching arrays and ranges — and above all, binary search.
Members only · free account
The rest of this lesson, with 4 more sections and code in JavaScript, Python, Java and C++, opens with a free account.
Was this helpful?
Not ready yet? The Arrays course is free to read, no account needed.
In the rest of this lesson