Checking a shortcut against the full contract

A support system must select the request with the highest urgency score. If several requests share that score, it must select the one with the smallest request identifier. Scores are whole numbers, identifiers are unique positive integers, and records arrive in no guaranteed order.


The original algorithm keeps a candidate and checks every remaining record. It replaces the candidate when the new record has a higher score, or when scores are equal and the new record has a smaller identifier.


A proposed shortcut skips a record whenever its score is less than or equal to the current candidate's score, without checking its identifier. Which assessment is correct?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Data Algorithms Questions: