Separating comparisons, calls, and depth

A Quick Sort execution sorts 1111 distinct job-priority scores. Each partition compares every non-pivot key with the pivot once and excludes the pivot from subsequent ranges. The pivot choices have these ranks within their active ranges:

  • In the eleven-key range, the pivot is the fourth-smallest key.
  • In the seven-key range, the pivot is the middle key, leaving three keys on each side.
  • In every three-key range, the pivot is the smallest key.
  • In every two-key range, the pivot is the smaller key.

Every invocation first checks its range size. A range of size zero or one returns immediately; every larger range partitions and invokes Quick Sort on both sides, completing the left call before starting the right call. Count the initial invocation, and count invocations on empty and singleton ranges.


The initial eleven-key range splits into three and seven keys, and the seven-key range splits into two three-key ranges.


Find the total key comparisons, the total Quick Sort invocations, and the maximum number of simultaneously active invocations. An invocation remains active while waiting for a child to return. Exclude pivot-selection comparisons. Give all three answers as exact integers, to zero decimal places.

Your answers

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: