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

Subjects · Leaving Cert Computer Science

Leaving Cert Computer Science: Sorting algorithms

How often Sorting algorithms 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 2024.

OL Asked on 1 of the last 5 Ordinary Level papers, most recently in 2025.

Sorting algorithms, Higher Level(9 marks)

Quick ones on Sorting algorithms.

(a)One pass of bubble sort (ascending) on [5, 1, 4, 2] gives?
  1. [1, 2, 4, 5]
  2. [1, 4, 2, 5]
  3. [1, 5, 4, 2]
(b)After the first pass of an ascending bubble sort, what is certain to be in its final place?
  1. The middle item
  2. The smallest item, at the start
  3. The largest item, at the end
(c)Selection sort (ascending) on [7, 3, 9, 1]: what is the list after the first swap?
  1. [1, 3, 9, 7]
  2. [1, 7, 9, 3]
  3. [3, 7, 9, 1]
Show the answers

(a) [1, 4, 2, 5]

(b) The largest item, at the end

(c) [1, 3, 9, 7]

Your turn: Higher Level questions on Sorting algorithms.

Higher Level

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

Every paper, year by year

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

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

Ordinary Level

Asked on 1 of the last 5 Ordinary Level papers, most recently in 2025.

Every paper, year by year

YearWhere it came up
2025A11
2024Not asked
2023Not asked
2022Not asked
2021Not asked

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

More Sorting algorithms questions

Sorting algorithms, 2 marks

Bubble sort compares and swaps…

  1. Only the first and last items
  2. Items picked at random
  3. Pairs of neighbouring items
Show the answer

Pairs of neighbouring items

Each pass compares neighbours and swaps them if they are out of order. After pass 1 the largest value has bubbled to the end.

Sorting algorithms, 3 marks

List [5, 1, 4, 2]. After ONE full pass of bubble sort (smallest first), the list is…

  1. [1, 5, 4, 2]
  2. [1, 4, 2, 5]
  3. [1, 2, 4, 5]
Show the answer

[1, 4, 2, 5]

5,1 swap: [1,5,4,2]. 5,4 swap: [1,4,5,2]. 5,2 swap: [1,4,2,5]. One pass isn't enough; more passes are needed.

Sorting algorithms, 2 marks

Selection (simple) sort, smallest first: each pass finds the…

  1. Smallest remaining item and puts it in place
  2. Middle item and moves it to the end of the list
  3. Two neighbours and swaps them if needed
Show the answer

Smallest remaining item and puts it in place

Pass 1 finds the smallest and puts it first, pass 2 the next smallest, and so on. Swapping neighbours is bubble sort.

Other Computer Science topics

All of Leaving Cert Computer Science