Please enable JavaScript to use CodeHS

CodeHS Glossary


Binary Search General

Search algorithm that only works on a sorted list. It discards half of the list on each iteration, getting to the solution much faster than Linear Search. Given a list and a value to search for, returns the index in the list that the value exists, or -1 if the value doesn't exist in the list. Big-Oh running time of O(log(n)) where n is the size of the input array.