Bubble Sort
- Initialize an outer loop to iterate through the entire array. Start with the variable i set to 0.
- Within the outer loop, initialize an inner loop to compare adjacent elements in the array. Start with the variable j set to 0.
- Compare the j-th element with the (j+1)-th element. If the j-th element is greater than the (j+1)-th element, swap them.
- Continue iterating through the array in this manner until the inner loop reaches the end of the array.
- After each iteration of the inner loop, the largest unsorted element will "bubble up" to its correct position at the end of the array.
- Increment the value of i in the outer loop and repeat the process until the entire array is sorted.