๐งช Bubble Sort Guided Worksheet
Goal: Sort in ascending order
Given List: [4, 2, 3, 1]
๐ต Pass 1
๐ Compare
4 and 2
Condition:
If 4 > 2 โ swap; otherwise keep as is
โ๏ธ Write new list:
๐ Compare
4 and 3
Condition:
If 4 > 3 โ swap; otherwise keep as is
โ๏ธ Write new list:
๐ Compare
4 and 1
Condition:
If 4 > 1 โ swap; otherwise keep as is
โ๏ธ Write new list:
๐ต Pass 2
๐ Compare
2 and 3
Condition:
If 2 > 3 โ swap; otherwise keep as is
โ๏ธ Write new list:
๐ Compare
3 and 1
Condition:
If 3 > 1 โ swap; otherwise keep as is
โ๏ธ Write new list:
๐ต Pass 3
๐ Compare
2 and 1
Condition:
If 2 > 1 โ swap; otherwise keep as is
โ๏ธ Write new list:
๐ฏ Final sorted list: [1, 2, 3, 4]