IPA FE Subject A 2026 Question 2
A question IPA Japan published in 令和8年度 基本情報技術者試験 科目A 公開問題 問2, translated into English. ITPEC is based on the same exams.
Same question on ITPEC: Oct 2020 Q7
Which of the following is a description of quicksort algorithm?
Explanation
Pick a pivot, then partition smaller elements before it and larger ones after — quicksort repeats this on each part until every part is sorted.
Each partition step puts the pivot in its final position. The two parts on either side are then sorted the same way, recursively. The average time is O(n log n); a pivot that is always the smallest or largest value degrades it to O(n2).
Answer (d)
Why not others:
- •(a) — comparing and swapping adjacent pairs pass after pass is bubble sort
- •(b) — repeatedly finding the minimum and taking it out is selection sort
- •(c) — inserting each element into its place in an already sorted sequence is insertion sort
Key rule: Match the sort to its core operation: adjacent swaps (bubble), minimum selection (selection), insertion into a sorted part (insertion), pivot and partition (quicksort), merging sorted runs (merge sort).
Algorithm and Programming · AI-written, may contain errors
This question comes from the past questions IPA Japan publishes, translated into English by ITPEC Practice. ITPEC Practice is an independent study tool and is not affiliated with IPA or ITPEC. See the original paper (PDF) or Report an issue.