Algorithms
Sorting and searching
Computers sort and search all the time. Bubble sort puts a list in order step by step, binary search finds something lightning fast in a sorted list.
Prior knowledge
Why
Someone is thinking of a number between 1 and 100. At most how many times do you have to guess if each time you hear: higher or lower?
If you try 1, 2, 3, …, it can take a hundred goes. If you guess cleverly, you never need more than seven.
The secret: start in the middle. Each time, half drops away. That only works if the numbers are in order. That is why computers sort so much.
Opening Kaft Plus…
Kaft Plus
The rest of “Sorting and searching” is in Kaft Plus
The learning path and the first 3 topics of Lus are free. Kaft Plus opens every topic and exercise.
Open with Kaft Plus
Already have Kaft Plus? The same button signs you in and brings you straight back.