Sorting and Searching
Official syllabus text (word for word)
Sorting and Searching — Sorting Techniques: Selection Sort, Insertion Sort, Quick Sort, Merge Sort, Heap Sort, Radix Sort. Searching Techniques: Linear Search, Binary Search, Hashing - Hashing functions: Mid square, Division, Folding, Digit Analysis; Collision Resolution: Linear probing, Quadratic Probing, Double hashing, Open hashing.
- 1Selection sort
Repeatedly select the smallest remaining element and swap it to the front.
lesson livevisualizerC codeasked 1× - 2Insertion sort
Insert each element into its correct place in the already-sorted left part.
lesson livevisualizerC codeasked 2× - 3Quick sort
Partition around a pivot, then recursively sort the two sides.
lesson livevisualizerC codeasked 3× - 4Merge sort
Split the array in half, sort each half, merge the two sorted halves.
lesson livevisualizerC codeasked 1× - 5Heap sort
Build a max-heap, then repeatedly move the root (maximum) to the end.
lesson livevisualizerC codeasked 1× - 6Radix sort
Sort digit by digit, least significant first, using stable buckets.
lesson livevisualizerC codeasked 2× - 7Linear search
Check every element in turn until the key is found.
lesson livevisualizerC code - 8Binary search
Halve the search interval of a sorted array at each step.
lesson livevisualizerC codeasked 1× - 9Hashing and hash functions
Map keys to table indices: division, mid-square, folding and digit analysis.
lesson livevisualizerC codeasked 4× - 10Collision resolution: linear probing, quadratic probing, double hashing
Resolve collisions inside the table: linear probing, quadratic probing, double hashing.
lesson livevisualizerC codeasked 2× - 11Open hashing (separate chaining)
Separate chaining: each slot holds a linked list of all keys that hash there.
lesson livevisualizerC codeasked 3× - 12Bubble sort (enrichment)bonus
Enrichment: repeatedly swap adjacent out-of-order pairs.
lesson livevisualizer