◒ MIDNIGHT ALGORITHMS

← All labs

Algorithms

Sorting Algorithms

Bubble sort repeatedly compares adjacent elements. Insertion sort grows a sorted prefix by moving each new element leftward into position.

Try this

Run both algorithms on the same initial array and compare the number of comparisons and swaps.

Use the labeled controls with your mouse or keyboard. The output above summarizes the visualization.