Learn how computers solve problems step by step!
Bubble Sort compares pairs of adjacent numbers and swaps them if they're in the wrong order.
It's called "Bubble" Sort because larger numbers "bubble up" to the end, like bubbles rising in water! 🫧
Steps:
1. Compare first two numbers
2. Swap if the left one is bigger
3. Move to the next pair
4. Repeat until everything is sorted!
Linear Search: Check each number one by one. Simple but slow!
Binary Search: If numbers are sorted, always check the middle! This eliminates half the numbers each time.
💡 Challenge: Can you find the number in less than 7 clicks using binary search?
Find the pattern and guess the next number!
Arithmetic: Add or subtract the same number each time (2, 4, 6, 8...)
Geometric: Multiply by the same number each time (2, 4, 8, 16...)
Fibonacci: Add the two previous numbers (1, 1, 2, 3, 5, 8...)
Computers use pattern recognition for everything from image processing to predictions!
This uses the Breadth-First Search (BFS) algorithm.
It explores all neighbors at the current distance before moving further away - like ripples in water!
GPS apps and video game characters use similar algorithms to find their way.