Data Structures & AlgorithmsModerate

In 3 1 4 4 5 2 6 6 7, an element is a RECORD if it is strictly larger than every element before it (the first element is not counted). How many records are there?

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

Correct answer: A. 4

Track the running maximum and count each strict increase; the first element is excluded by definition here. Accepting ties, including index 0 in the count, or counting new minima instead answers different questions.

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

Exams that ask this topic