Data Structures & AlgorithmsHardTCS NQT · Accenture

How many elements of [2, 5, 1, 4, 3] have no strictly smaller element anywhere to their right?

  1. A. 3
  2. B. 2
  3. C. 4
  4. D. 6

Correct answer: B. 2

The value 1 has only larger values to its right, and the last element 3 trivially qualifies. Each other element has a smaller value somewhere to its right.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic