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)

**(A)** Solves it in linear time using a left to right pass of the array

**(B)** Solves it in linear time using a right to left pass of the array

**(C)** Solves it using divide and conquer in time 8(nlogn)

**(D)** Solves it in time 8(n2)

**Answer:** **(B)** **Explanation:** Please see this for explanation.

Quiz of this Question

## Recommended Posts:

- Algorithms | Misc | Question 16
- Algorithms | Misc | Question 11
- Algorithms | Misc | Question 11
- Algorithms | Misc | Question 3
- Algorithms | Misc | Question 13
- Algorithms | Misc | Question 5
- Algorithms | Misc | Question 7
- Algorithms | Misc | Question 8
- Algorithms | Misc | Question 9
- Algorithms | Misc | Question 10
- Algorithms | Misc | Question 11
- Algorithms | Misc | Question 12
- Algorithms | Misc | Question 13
- Algorithms | Misc | Question 14
- Algorithms | Misc | Question 15
- C | Misc | Question 1
- C | Misc | Question 2
- C | Misc | Question 7
- C | Misc | Question 6
- C | Misc | Question 5