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
Learn More
Related Terms
Built-in methods on the Array prototype for transforming and querying arrays. Key methods include map (transform each element), filter (select elements), reduce (accumulate), find (first match), some/every (boolean tests), and sort.
Big O NotationA mathematical notation that describes the upper bound of an algorithm's time or space complexity as input size grows. Common complexities from fastest to slowest: O(1), O(log n), O(n), O(n log n), O(n^2), O(2^n).
RecursionA technique where a function calls itself to solve smaller instances of the same problem. Every recursive function needs a base case (stopping condition) and a recursive case. Common in tree traversals, divide-and-conquer algorithms, and mathematical computations.