Ceist Eile is in development. Features, questions and prices may change while we refine it.

Subjects · Leaving Cert Computer Science

Leaving Cert Computer Science: Quicksort

How often Quicksort comes up on the Computer Science papers, every year it was asked, and questions to try.

HL Asked on 2 of the last 5 Higher Level papers, most recently in 2025.

Quicksort, Higher Level(8 marks)

Quick ones on Quicksort.

(a)What is the item that quicksort splits the list around called?
  1. The key
  2. The pivot
  3. The index
(b)Partition [6, 2, 9, 1, 7] around pivot 6, keeping order. What is the left sub-list?
  1. [2, 1, 6]
  2. [1, 2]
  3. [2, 1]
(c)Which pivot choice gives quicksort its worst-case performance?
  1. The smallest or largest item each time
  2. An item close to the middle value each time
  3. The true median item every single time
Show the answers

(a) The pivot

(b) [2, 1]

(c) The smallest or largest item each time

Your turn: Higher Level questions on Quicksort.

Higher Level

Asked on 2 of the last 5 Higher Level papers, most recently in 2025.

Every paper, year by year

YearWhere it came up
2025B14
2024Not asked
2023A10
2022Not asked
2021Not asked

Links open the State Examinations Commission’s paper for that year.

More Quicksort questions

Quicksort, 3 marks

After a quicksort partition, where is the pivot?

  1. Always at the start of the list
  2. Always at the end of the list
  3. In its final sorted position
Show the answer

In its final sorted position

Everything smaller is on its left and everything larger on its right, so the pivot never has to move again. Only the sub-lists still need sorting.

Quicksort, 3 marks

Why might quicksort choose its pivot at random?

  1. So that no comparisons are needed
  2. To avoid the worst case on already-sorted data
  3. To use less memory than any other sort
Show the answer

To avoid the worst case on already-sorted data

With the first item as pivot, sorted data gives an empty left sub-list every time and O(n²) time. A random pivot makes that very unlikely.

Other Computer Science topics

All of Leaving Cert Computer Science