Index

DSA · Sorting: constants against growth

Sorting aur searching

Merge sort is O(n log n) and insertion sort is O(n²). On the list you actually have, which one does less work?

Five sorts are handed a copy of the same list and made to do the work, with comparisons and moves counted separately. The tabs change the shape the list arrives in and the slider changes its length. Watch the cheapest sort on this list change name when the shape does, even though nothing about the algorithms moved.

Board: Sorting aur Searching →

Three panels, two rows of tabs, a slider and three tables. On a narrow screen the panels stack. Nothing animates or plays on its own.

try this Open Already in order, then Exactly backwards, and watch which sort is named under Cheapest sort on this list.

Included with a plan

This lab is included with a plan. The first three lessons of every track are free, with their boards and videos. A plan unlocks every lesson, board, video, lab and paper for one price.

View plans →Already a member? Sign in