Sorting I ✔
- Selection Sort
- Left Portion is sorted, right portion is unsorted
- Find minimum element of unsorted array
- Replace the minimum element with the first item which become the last item of sorted array
- Prevent swap if they are both
- Bubble Sort
- Insertion Sort
- 10 April, 2026: 00.09.19 ❌
- Failed at implmentation
- First item is consider as sorted.
- Right portion from second item is consider as unsorted.
- Inner loop: find out where the insertion should be placed for the first item of unsorted portion
-
Iterate from last item to lesser item of sorted portion
-
Instead of swapping, perform shifting operation
Step Key Compared With Action Taken Array State 1 3 8 Shift 8 right [8, 8, 1, 7, 0, 10, 2] — Insert 3 at position 0 [3, 8, 1, 7, 0, 10, 2] 2 1 8 Shift 8 right [3, 8, 8, 7, 0, 10, 2] 3 Shift 3 right [3, 3, 8, 7, 0, 10, 2] — Insert 1 at position 0 [1, 3, 8, 7, 0, 10, 2] 3 7 8 Shift 8 right [1, 3, 8, 8, 0, 10, 2] 3 Stop (3 < 7) — — Insert 7 at position 2 [1, 3, 7, 8, 0, 10, 2] 4 0 8 Shift 8 right [1, 3, 7, 8, 8, 10, 2] 7 Shift 7 right [1, 3, 7, 7, 8, 10, 2] 3 Shift 3 right [1, 3, 3, 7, 8, 10, 2] 1 Shift 1 right [1, 1, 3, 7, 8, 10, 2] — Insert 0 at position 0 [0, 1, 3, 7, 8, 10, 2] 5 10 8 Stop (8 < 10) — — No shift, stays in place [0, 1, 3, 7, 8, 10, 2] 6 2 10 Shift 10 right [0, 1, 3, 7, 8, 10, 10] 8 Shift 8 right [0, 1, 3, 7, 8, 8, 10] 7 Shift 7 right [0, 1, 3, 7, 7, 8, 10] 3 Shift 3 right [0, 1, 3, 3, 7, 8, 10] 1 Stop (1 < 2) — — Insert 2 at position 2 [0, 1, 2, 3, 7, 8, 10]
-
- Failed at implmentation
- 10 April, 2026: 00.09.19 ❌