/utils

Glossary

Short definitions of the terms used on this site, with links to where they matter.

A

Adaptive
A sorting algorithm is adaptive if it runs faster on input that is already nearly sorted.
See: Bubble Sort, Insertion Sort

D

Dot product
The sum of the products of corresponding entries of two equal-length vectors: x · y = x₁y₁ + … + xₙyₙ.
See: Matrix Multiplication

H

Heap
A binary tree stored in an array in which every parent is at least as large as its children (max-heap). The children of index i are 2i + 1 and 2i + 2.
See: Heap Sort

I

In-place
An algorithm is in-place if it rearranges its input using only a small amount of extra memory, typically O(1) or O(log n).
See: Insertion Sort, Quicksort, Counting Sort
Inversion
A pair of positions i < j with a[i] > a[j]. A sorted array has none; a reversed array of n elements has n(n − 1)/2.
See: Insertion Sort, Binary Insertion Sort, Bubble Sort

P

Partition
Rearranging a sequence around a pivot so that smaller elements come before it and the rest after it.
See: Quicksort
Pivot
The element a partition step compares all others with. After partitioning it sits at its final sorted position.
See: Quicksort

R

Radix (base)
The number of distinct digits in a positional number system, e.g. 2 for binary and 16 for hexadecimal.
See: Number Base Converter

S

Stable sort
A sort that keeps elements with equal keys in their original relative order.
See: Insertion Sort, Binary Insertion Sort, Bubble Sort, Bucket Sort, Counting Sort, Heap Sort, Introsort, Merge Sort, Quicksort, Radix Sort, Selection Sort, Shell Sort, Timsort