Counting comparisons on ordered records

A program uses Quick Sort to sort 1212 distinct record identifiers that are already in increasing order. Every partition selects the last key, scans each other key once using a strict less-than test, and then recursively sorts the two sides. Ranges containing zero or one key return immediately.


How many comparisons between scanned keys and pivots occur during the complete sort? Exclude index tests and pivot-selection work. Enter an integer count, to zero decimal places.

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 Quick Sort Questions: