GATE Exam | Aptitude Questions | GATE Syllabus | GATE Result | Mock Test | GATE Preparation
0 votes

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

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 (nlogn)

D

Solves it in time 8n2

asked in algorithms by gate

1 Answer

0 votes

Solves it in linear time using a right to left pass of the array

answered by gate

Related questions

The best answer to any question