<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Algorithms &amp; Data Structures — the bound is a claim, and it is checkable</title>
  <subtitle>Illustrated essays on algorithms with the complexity claims measured rather than asserted: operation counts fitted across three orders of magnitude, the information-theoretic floor computed exactly, and cache behaviour modelled alongside the textbook count.</subtitle>
  <link href="https://www.algorithms-data-structures.com/feed.xml" rel="self"/>
  <link href="https://www.algorithms-data-structures.com/"/>
  <id>https://www.algorithms-data-structures.com/</id>
  <updated>2026-08-05T05:03:45.273Z</updated>
  <entry>
    <title>Counting instead of timing</title>
    <link href="https://www.algorithms-data-structures.com/essays/counting-instead-of-timing/"/>
    <id>https://www.algorithms-data-structures.com/essays/counting-instead-of-timing/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>A stopwatch measures the laptop it runs on. A counter measures the algorithm. Every number on this site comes from an array that increments a tally each time it is read, written, compared or swapped — which makes the counts exact, reproducible to the last digit, and identical on every machine that has ever built this page.</summary>
  </entry>
  <entry>
    <title>What O-notation does not say</title>
    <link href="https://www.algorithms-data-structures.com/essays/what-o-notation-does-not-say/"/>
    <id>https://www.algorithms-data-structures.com/essays/what-o-notation-does-not-say/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>Big-O is a statement about a limit. It does not say how fast, it does not say which is better, it does not say anything at all about any particular n, and it discards precisely the factor that usually decides the answer. Knowing exactly what it claims is the difference between using it and being misled by it.</summary>
  </entry>
  <entry>
    <title>The floor under every comparison sort</title>
    <link href="https://www.algorithms-data-structures.com/essays/the-floor-under-every-comparison-sort/"/>
    <id>https://www.algorithms-data-structures.com/essays/the-floor-under-every-comparison-sort/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>No algorithm that sorts by comparing pairs of elements can average fewer than log₂(n!) comparisons. Not one that exists, and not one that ever will. The argument takes three sentences, it is about counting leaves in a tree, and it is one of the few results in this subject that is genuinely about every possible algorithm rather than about a particular one.</summary>
  </entry>
  <entry>
    <title>The count is not the time</title>
    <link href="https://www.algorithms-data-structures.com/essays/the-count-is-not-the-time/"/>
    <id>https://www.algorithms-data-structures.com/essays/the-count-is-not-the-time/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>An operation count is exact, machine-independent, and not a running time. The gap between them is mostly memory, and it is large enough to reorder the rankings. This site carries a second count — modelled cache misses from the same runs — and asserts that the two disagree, because if they agreed the second one would carry no information.</summary>
  </entry>
  <entry>
    <title>What amortised means</title>
    <link href="https://www.algorithms-data-structures.com/essays/what-amortised-means/"/>
    <id>https://www.algorithms-data-structures.com/essays/what-amortised-means/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>Appending to a dynamic array is O(1) amortised. It is also, on 512 appends, an operation that costs one unit 503 times and 257 units once. The amortised bound is a true statement about the sequence and a false one about any append in it, and the picture that shows why is a sawtooth nobody draws.</summary>
  </entry>
  <entry>
    <title>The words &quot;on average&quot; are not a number</title>
    <link href="https://www.algorithms-data-structures.com/essays/on-average-is-not-a-number/"/>
    <id>https://www.algorithms-data-structures.com/essays/on-average-is-not-a-number/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>Quicksort is Θ(n log n) on average. Six hundred runs at n = 512 give a distribution with a mean of 4,945 comparisons, a median of 4,908, and a worst case 32% above the mean. The average is a summary of that picture, it is the least interesting thing in it, and it is almost always the only thing reported.</summary>
  </entry>
  <entry>
    <title>Fitting a class to measurements</title>
    <link href="https://www.algorithms-data-structures.com/essays/fitting-a-class-to-measurements/"/>
    <id>https://www.algorithms-data-structures.com/essays/fitting-a-class-to-measurements/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>A complexity class is normally read off the shape of the loops and written down. Here it is fitted to counts taken across three orders of magnitude, and an algorithm is granted a class only if the fit holds — which turns a statement about code into a statement that can fail.</summary>
  </entry>
  <entry>
    <title>The constant the notation drops</title>
    <link href="https://www.algorithms-data-structures.com/essays/the-constant-the-notation-drops/"/>
    <id>https://www.algorithms-data-structures.com/essays/the-constant-the-notation-drops/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>Six algorithms on this site are Θ(n log n) and their comparison counts differ by a factor of two. The class is what they have in common; the constant is what distinguishes them. It is measurable to three digits, it is the number that actually decides between them, and it is precisely the number the classification is designed to discard.</summary>
  </entry>
  <entry>
    <title>How close anything gets to the floor</title>
    <link href="https://www.algorithms-data-structures.com/essays/how-close-anything-gets-to-the-floor/"/>
    <id>https://www.algorithms-data-structures.com/essays/how-close-anything-gets-to-the-floor/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>The interesting question about a sorting algorithm is not its complexity class but its distance from the bound nothing can cross. Merge sort comes within 2.2% of the information-theoretic floor. Heapsort uses 96% more than it needs to. Selection sort uses nineteen times. Those three numbers say more than the classification does.</summary>
  </entry>
  <entry>
    <title>The cliff where the data stops fitting</title>
    <link href="https://www.algorithms-data-structures.com/essays/the-cliff-where-the-data-stops-fitting/"/>
    <id>https://www.algorithms-data-structures.com/essays/the-cliff-where-the-data-stops-fitting/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>Below the cache&#39;s capacity, almost every access hits. A factor of eight above it, almost every access misses. The transition is not gradual and it is not a property of any algorithm — it is a property of how much data there is, and an algorithm&#39;s complexity class says nothing about which side of it a program is working on.</summary>
  </entry>
  <entry>
    <title>Choosing a growth factor</title>
    <link href="https://www.algorithms-data-structures.com/essays/choosing-a-growth-factor/"/>
    <id>https://www.algorithms-data-structures.com/essays/choosing-a-growth-factor/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>When a dynamic array fills up, how much bigger should the new one be? Doubling costs 2.02 units per append and leaves 39% of the allocation empty. Growing by an eighth costs 9.89 and leaves 10%. Every factor is a trade between time and space, no factor wins on both, and real implementations disagree about the answer for reasons that are measurable.</summary>
  </entry>
  <entry>
    <title>What randomising the pivot buys</title>
    <link href="https://www.algorithms-data-structures.com/essays/what-randomising-the-pivot-buys/"/>
    <id>https://www.algorithms-data-structures.com/essays/what-randomising-the-pivot-buys/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>Quicksort taking the first element as its pivot costs 130,816 comparisons on an already sorted array of 512 — 27 times its cost on random data, and exactly the quadratic behaviour the algorithm exists to avoid. Randomising the pivot costs 5,490 on the same input. Randomisation does not make the bad case impossible; it makes it unchoosable.</summary>
  </entry>
  <entry>
    <title>One run, four counts, four answers</title>
    <link href="https://www.algorithms-data-structures.com/essays/one-run-two-counts/"/>
    <id>https://www.algorithms-data-structures.com/essays/one-run-two-counts/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>The question “how many operations” has no answer until the operation is named. Selection sort makes more comparisons than any other algorithm here and fewer writes than almost all of them; bubble sort matches its comparisons and does 124 times the swapping. The ranking depends entirely on which count is chosen, and the choice needs justifying.</summary>
  </entry>
  <entry>
    <title>A limit is not a prediction</title>
    <link href="https://www.algorithms-data-structures.com/essays/a-limit-is-not-a-prediction/"/>
    <id>https://www.algorithms-data-structures.com/essays/a-limit-is-not-a-prediction/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>Measured from n = 64 to n = 4,096, this site&#39;s hybrid merge sort fits a linear class better than n log n. Measured out to n = 65,536, the ranking reverses. Nothing changed but the range — and this is not a flaw in the method, it is the method finding the exact place where measurement stops being able to help.</summary>
  </entry>
  <entry>
    <title>The floor moves when the question does</title>
    <link href="https://www.algorithms-data-structures.com/essays/the-floor-moves-when-the-question-does/"/>
    <id>https://www.algorithms-data-structures.com/essays/the-floor-moves-when-the-question-does/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>Sorting 4,096 elements needs at least 43,250 comparisons. Finding one element among the same 4,096, already sorted, needs at least 13. The difference is a factor of 3,300 and it comes entirely from how many different answers the algorithm has to be able to give. A lower bound is a property of the question, not of any algorithm.</summary>
  </entry>
  <entry>
    <title>Where an algorithm looks</title>
    <link href="https://www.algorithms-data-structures.com/essays/where-an-algorithm-looks/"/>
    <id>https://www.algorithms-data-structures.com/essays/where-an-algorithm-looks/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>Plotted as index against time, every array access an algorithm makes becomes a picture that no count contains. Merge sort&#39;s is a set of sweeps. Heapsort&#39;s is a spray. Quicksort&#39;s is a narrowing triangle. These shapes decide how fast the algorithms run and they are entirely absent from the analysis that says all three are Θ(n log n).</summary>
  </entry>
  <entry>
    <title>The tree that is a list</title>
    <link href="https://www.algorithms-data-structures.com/essays/the-tree-that-is-a-list/"/>
    <id>https://www.algorithms-data-structures.com/essays/the-tree-that-is-a-list/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>A binary search tree gives logarithmic lookup. Build one from 128 keys in sorted order and it has height 127 — every node has one child, and a lookup is a linear scan. The failure is not gradual and it happens on the input people try first, which makes &quot;O(log n) lookup&quot; a claim about the insertion order rather than about the structure.</summary>
  </entry>
  <entry>
    <title>The probe formula nobody checks</title>
    <link href="https://www.algorithms-data-structures.com/essays/the-probe-formula-nobody-checks/"/>
    <id>https://www.algorithms-data-structures.com/essays/the-probe-formula-nobody-checks/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>The expected number of probes to insert into a hash table under linear probing is ½(1 + 1/(1−α)²). It is quoted constantly, it is correct, and applied to a table of 256 slots at 95% load it overstates the measured cost by nearly half — because it is an asymptotic result and a real table is not asymptotic.</summary>
  </entry>
  <entry>
    <title>Where insertion sort actually wins</title>
    <link href="https://www.algorithms-data-structures.com/essays/where-insertion-sort-actually-wins/"/>
    <id>https://www.algorithms-data-structures.com/essays/where-insertion-sort-actually-wins/</id>
    <updated>2026-08-05T05:03:45.273Z</updated>
    <summary>Every production sorting routine falls back to insertion sort on small subarrays, and the usual explanation is that below some threshold it does fewer comparisons. Measured, it does not — not at sixteen elements, not at eight, not at four. The crossover is real and it is entirely in memory traffic, which is a distinction the usual telling loses.</summary>
  </entry>
</feed>
