BINARY SEARCH ON REVERSE SORTED ARRAY:
Let's suppose that we have an array sorted in descending order and we want to find index of an element e within this array. Binary search in every step picks the middle element (m) of the array and compares it to e. If these elements are equal, than it returns the index of m. If e is greater than m, than e must be located in the left subarray. On the contrary, if m greater than e, e must be located in the right subarray. At this moment binary search repeats the step on the respective subrarray.
Because the algoritm splits in every step the array in half (and one half of the array is never processed) the input element must be located (or determined missing) in at most \\log_{2}{n} steps.
PROBLEM STATEMENT LINK:http://www.programming-algorithms.net...
PLAYLIST LINK: • Binary Search | Interview Questions |... .
------------------------------------------------------------------------------------------
Here are some of the gears that I use almost everyday:
🖊️ : My Pen (Used in videos too): https://amzn.to/38fKSM1
👨🏻💻 : My Apple Macbook pro: https://amzn.to/3w8iZh6
💻 : My gaming laptop: https://amzn.to/3yjcn23
📱 : My Ipad: https://amzn.to/39yEMGS
✏️ : My Apple Pencil: https://amzn.to/3kMnKYf
🎧 : My Headphones: https://amzn.to/3kMOzM7
💺 : My Chair: https://amzn.to/385weqR
🛋 : My Table: https://amzn.to/3kMohtd
⏰ : My Clock: https://amzn.to/3slFUV3
🙋🏻♀️ : My girlfriend: https://amzn.to/3M6zLDK ¯\_(ツ)_/¯
PS: While having good gears help you perform efficiently, don’t get under the impression that they will make you successful without any hard work.
Watch video 3 Binary Search on Reverse Sorted Array online without registration, duration hours minute second in high quality. This video was added by user Aditya Verma 11 March 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 123,45 once and liked it 2.7 thousand people.