Bubble Sort repeatedly compares adjacent elements and swaps them if they are in the wrong order.
π Bigger elements βbubble upβ to the end of the array after every pass.
Think of it like:
Heavy bubbles rising slowly to the surface.
[64, 25, 12, 22, 11]
Compare adjacent elements:
[25, 12, 22, 11, 64]
π Largest element 64 is now at the correct position.