Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
- Sort any type that implements Comparable (compareTo).
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight
Medium
- Selection sort: find the minimum of the rest, swap it into position i.
Asked in a real exam
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight
High
- Selection sort: ~n²/2 compares and n exchanges, regardless of input order.
🎯 How this can come up · 1 question
MCQ
Selection sort on an already sorted array takes:
Correct: Quadratic time.
Exam weight Low
Exam weight Low
Exam weight Low
- Insertion sort: move element i left past every larger element.
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight
High
- Insertion sort: best case (sorted) ~n compares; worst (reverse) ~n²/2; average ~n²/4.
🎯 How this can come up · 1 question
MCQ
Which elementary sort runs in linear time on an already sorted array?
Correct: Insertion sort.
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
No slides match this filter.