Which needs more comparisons
Exercise and reference answers
- Questions
- A
- Key is first
- B
- Key is last
- Higher value
- Key is last
- A
- Key is absent
- B
- Key is first
- Higher value
- Key is absent
- A
- Key is first
- B
- Key is absent
- Higher value
- Key is absent
- A
- Linear on n items
- B
- Binary on n items
- Higher value
- Linear on n items
- Instructions
- Tap the case that needs more comparisons.
Explanation
_Source: syllabus Computer Science, Ch 5 'Sorting' and Ch 6 'Searching'_