Worksheets › Class 9 › Searching and Sorting › Cheat sheet

Class 9 Searching and Sorting: cheat sheet

CBSE Computational Thinking and AI. Linear search checks every item; binary search halves a sorted list. Bubble sort and selection sort put a list in order pass by pass.

Open the printable cheat sheetPractice worksheet

Key ideas

Remember

Linear search checksthe position of the item, or all n if it is not there
Binary search, worst case for n itemsthe smallest k with 2ᵏ > n: 100 items → 7, 1,000 → 10
Bubble pass on 5, 1, 4, 21, 4, 2, 5 (3 swaps)
Total bubble swapsthe number of pairs that are out of order
Selection sort, n itemsn − 1 passes

Watch out

Worked example

Bubble sort swaps neighbouring items that are in the wrong order. How many swaps in all does it make to sort 52, 28, 36, 43, 3, 54?

Working: every swap fixes one out-of-order pair; count those pairs

Answer: 7

Practise Searching and Sorting

Revise with this page, then practise: every Searching and Sorting sheet in the app is new, with an answer key and working.

Coming soon for Android and iPhone.