Advanced Data Structures – Summer 2026 – Lecture 1

We want to design fast algorithms, but when is an algorithm fast?

Big-\(O\), or \(\mathcal O\) notation relates the asymptotic growth of two abstract functions to each other.
Given two functions \(f, g: \mathbb N \to \mathbb R_{\geq 0}\), we say that
when there exists constants \(n_0\in \mathbb N\) and \(M\in \mathbb R\) such that for all sufficiently large \(n\geq n_0\): \[ f(n) \leq M\cdot g(n).\]


All of the above!
Expected complexity of Van Emde-Boas trees
Fastest randomized algorithm
Randomized when \(w \geq (\lg n)^{2+\varepsilon}\)
Figure 1: Algorithm 64: Quicksort (Hoare 1961). RIP Tony Hoare.



Let \(S\) be the minimum space required to represent some data.
A compact data structure uses \(O(S)\) bits of space.
A succinct data structure uses \(S + o(S)\) bits of space.
Example: many Rank & Select data structures are succinct.
An implicit data structure uses \(S + O(1)\) bits of space.
Example: bit arrays.

Allows mutating the structure.
Example: hash tables.
Build once, then read-only queries.
Example: minimal perfect hash functions.
Insert-only; deletions not allowed.
Example: bloom filters.

From stronger to weaker:
An algorithm has worst-case running time \(O(f(n))\) when for every possible input, it is guaranteed to finishes in \(O(f(n))\) time.
An algorithm has expected running time \(O(f(n))\) when for every possible input, the expected running time is \(O(f(n))\).
An algorithm has running time \(O(f(n))\) with high probability (w.h.p.) when for every possible input, the running time is \(O(f(n))\) with probability \(1-o(1)\).
An operation on a data structure has amortized running time \(O(f(n))\) when for every possible sequence of \(i\) operations with amortized complexities \(f_i\), the total running time is \(O(\sum_i f_i)\).
Example: pushing on a vector is worst-case \(O(n)\), but amortized \(O(1)\).


Models a machine that has an infinite list of registers.
Any problems with this?

Like the RAM model, but each register can store a real number.

Like the RAM model, but operates on words of \(w\) bits.
Evolved with CPUs to include: https://en.wikipedia.org/wiki/X86_Bit_manipulation_instruction_set
popcnt), count trailing zeros (tzcnt, BMI1)pdep), parallel bit extract (pext, BMI2)Most commonly used model.
Any remaining problems with this?

Solution: we assume \[ \lg n \leq w. \] This has far-reaching implications!

RAM-model without the RAM:
Used in the analysis of some heap-based priority queues.

Like the RAM-model, but all operations apart from accessing memory are free.

The latency of a uniform random access into a memory of size \(n\) is at least \[\Omega(\sqrt[3]{n}).\]

We can store/cool at most \(O(r^2)\) bits in a sphere of radius \(r\), and so the latency of a uniform random access into a memory of size \(n\) is at least \[\Omega(\sqrt[2]{n}).\]

\(\sqrt[3]{1} + \sqrt[3]{2}+\dots+\sqrt[3]{n} = \Theta(\sqrt[3]n)\).

Introduced by Aggarwal and Vitter (1988).
Like the cell-probe model, the I/O-complexity only counts I/O operations.
Sorting \(n\) word-sized integers has an I/O-complexity lower-bound of \[ \Omega\left(\frac n B \log_{M/B} \frac nB\right), \] and external merge-sort achieves this.

We need precisely defined models to theoretically analyse algorithms.
Models approximate reality; some do so better than others.
The rest of this course will mostly use the word RAM model to analyse both theoretically and practically efficient algorithms.




