An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
January 13, 2022 05:56 pm GMT
Original Link: https://dev.to/rounit08/binary-search-is-not-for-sorted-arrays-only--2aba
Binary search is not for sorted arrays only !
While talking about ' Binary Search ' , we consider that it will only work for "Sorted arrays" , but that's not the condition.
It will work for " Unsorted arrays" also ,
yes but only one kind of "unsorted array" ,
i.e., The Rotated Array.
It can be done in O(log n) time complexity , like a binary search , but it uses different method .
It uses "adjusted divide and conquer algorithm"
The DAC
And ssshhhh it will be solved recursively only
Original Link: https://dev.to/rounit08/binary-search-is-not-for-sorted-arrays-only--2aba
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To