JavaScript is required for this website. Please allow JavaScript and refresh the page.
home Home
sort Sorts
Quick Sort Merge Sort Heap Sort
Bubble Sort Selection Sort Insertion Sort Gnome Sort Shaker Sort Odd Even Sort Pancake Sort
Bitonic Sort Radix Sort Shell Sort Comb Sort Bogo Sort Stooge Sort
Your Sort
Bitonic Sort
Elements: 100

Bitonic Sort is a sorting algorithm based on comparisons. It exploits binary sequences, so it can be applied only on data structures with number of elements equal to a power of 2.

The algorithm is made up of two parts. Initially, the data structure gets converted to a binary sequence, creating groups of ascending and descending elements linked together. Next, the groups get merged with an algorithm similar to Merge Sort until the data structure is sorted.

It can be implemented in numerous variants, iteratively or recursively, with different visualizations. This visualization shows an iterative version.

Average Complexity O(log2 n)
Best Case O(log2 n)
Worst Case O(log2 n)
Space Complexity O(n × log2 n)