Data Structures

Sorting Algorithm

Definition

An algorithm that arranges elements in a specific order. Common algorithms include Bubble Sort O(n^2), Merge Sort O(n log n), and Quick Sort O(n log n) average. JavaScript's built-in `Array.sort()` uses Timsort.

Code Example

Javascript
Tip: Modify the code above and click “Run” to see the results

Learn More

Related Terms