A Guide to Understanding Binary Search

In working with collections (lists, queues, maps) of data, we usually have to perform one or more of the following operations on the collection: accessing, searching, appending, inserting, replacing/swapping, deleting and sorting Binary search is one of the most popular algorithms for searching for a number within a sorted list of numbers. It has a time complexity of O(log N) which means that its ability to find a number in a sorted list is minimally affected by the length of numbers in the list....

June 1, 2024 · 7 min · Orim Dominic Adah