ProgrammingHard

Records A (key 9), B (key 3), C (key 9) are scanned with if (r.key >= best.key) best = r; starting from the first record. Which record is kept?

  1. A. C
  2. B. A
  3. C. B
  4. D. none of them

Correct answer: A. C

The >= test replaces the best on each tie, so the last record with the maximum key, C, wins.

More C Programming questions

Exams that ask this topic