<DS/>DS_VISUALIZER
FoundationsOOPArraysLinked ListStacksQueuesTreesGraphsHashingStrings
exploreExplore
homechevron_rightTopicschevron_rightArrayschevron_rightSorting
sort

ARRAYS · CATEGORY

Sorting

Order the elements — compare, swap, partition, merge.

Choose an algorithm

sortarrow_outward

Bubble Sort

Adjacent compare-and-swap.

O(n²)O(1)◍ 0/5
filter_listarrow_outward

Selection Sort

Pick the minimum each pass.

O(n²)O(1)◍ 0/5
playlist_addarrow_outward

Insertion Sort

Grow a sorted prefix.

O(n²)O(1)◍ 0/5
call_splitarrow_outward

Merge Sort

Divide, sort halves, merge.

O(n log n)O(n)◍ 0/5
swap_vertarrow_outward

Quick Sort

Partition around a pivot.

O(n log n)O(log n)◍ 0/5