ITPEC FE Morning October 2020 Question 7
ITPEC FE Morning October 2020 — Question 7 of 80
Quicksort Algorithm — select a pivot, partition into smaller/larger groups, repeat recursively.
Quicksort works by:
- Selecting a pivot element
- Partitioning the array so smaller elements go before the pivot, larger ones go after
- Recursively applying the same process to each partition
Why not others:
- (a) Bubble Sort — compares and swaps adjacent pairs repeatedly
- (b) Selection Sort — finds the minimum element, removes/swaps it to sorted position
- (c) Insertion Sort — inserts each element into its correct position in a growing sorted sequence
Key rule: Quicksort = pivot + partition + recurse. Average time complexity is O(n log n), worst case O(n²).
AI-generated — may contain errors
The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.