An element in an array X is called a leader if it is greater than all elements to the right of it in X. The best algorithm to find all leaders in an array (GATE CS 2006)
Solves it in linear time using a left to right pass of the array
Solves it in linear time using a right to left pass of the array
Solves it using divide and conquer in time 8(nlogn)
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy