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.
Quick ones on Quicksort.
- The key
- The pivot
- The index
- [2, 1, 6]
- [1, 2]
- [2, 1]
- The smallest or largest item each time
- An item close to the middle value each time
- The true median item every single time
Show the answers
(a) The pivot
(b) [2, 1]
(c) The smallest or largest item each time
Higher Level
Asked on 2 of the last 5 Higher Level papers, most recently in 2025.
Every paper, year by year
| Year | Where it came up |
|---|---|
| 2025 | B14 |
| 2024 | Not asked |
| 2023 | A10 |
| 2022 | Not asked |
| 2021 | Not 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?
- Always at the start of the list
- Always at the end of the list
- 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?
- So that no comparisons are needed
- To avoid the worst case on already-sorted data
- 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
- Abstraction & pattern recognition
- Binary & hexadecimal
- CPU, memory & storage
- Embedded systems & sensors
- Ethics & social impact
- Flowcharts & pseudocode
- Internet, WWW & protocols
- Loops & trace tables
- Problem solving & puzzles
- Selection & Boolean logic
- Universal design & accessibility
- Variables, data types & operators
- Algorithmic complexity
- Data analytics & data quality
- Functions & modules
- Logic gates & truth tables
- Roles, teams & stakeholders
- Searching algorithms
- Testing & debugging
- AI & machine learning
- ASCII & Unicode
- Design process & SDLC
- History & emerging trends
- Lists
- Privacy & cybersecurity
- Basic electronics
- Databases
- Modelling & simulation
- Operating systems
- Recursion
- Sorting algorithms
- Strings & string methods
- Heuristics
- Turing machines