Data Structures & AlgorithmsVery hard

What is the minimum product of two ADJACENT elements of 5 3 8 2 9 4?

  1. A. 8
  2. B. 6
  3. C. 16
  4. D. 15

Correct answer: D. 15

Only adjacent pairs qualify, so scan the n−1 neighbouring products. Taking the sum, skipping one position, or allowing any pair of positions changes the minimum.

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

Exams that ask this topic