TheAlgorithms / Solidity

Algorithms and data structures implemented in Solidity
GNU Lesser General Public License v2.1
326 stars 88 forks source link

Binary_search_algorithm #25

Closed Chiadikaobixo closed 2 years ago

Chiadikaobixo commented 2 years ago

Binary search is a searching algorithm with a timecomplexity of O(LogN), it's a more faster way of searching for a value in an array. It works on only sorted arrays. Rather than eliminating one element at a time, binary search eliminate half of the remaining elements at a time and returns the index position of the value in the array. https://en.wikipedia.org/wiki/Binary_search_algorithm