How does the Sentinel Search work?
Loading
Virtual. Every session is recorded and published here on CSharp TV.
Write an article and earn +100 points when it is approved.
Write an articleHow does the Sentinel Search work?
The Sentinel Search, also known as the Galloping Search, is a variation of the Binary Search algorithm that is used to search for an element in a sorted array which has been rotated by an unknown amount.
The algorithm starts by comparing the target element with the middle element of the array. If the middle element is the target element, the search is complete. If not, then one half of the array is sorted, and the other half is unsorted.