Data Structure Code Examples
These are some data structures, with a simple test environment,
that are based on my book.
Chapter 1
 An arraybased stack.
 A listbased stack.
 A blocklistbased stack.
 An arraybased queue.
 A listbased queue.
 A cyclic listbased queue.
 A doubly linked listbased queue.
 The free list code.
 An arraybased stack with shadow copy.
Chapter 2

A trivial search tree, without rebalancing.

A topdown optimal search tree.

A bottomup optimal search tree.
Chapter 3

A heightbalanced search tree.

A weightbalanced search tree.

An (a,b)tree.

A redblack search tree.

A redblack tree with topdown rebalancing.

A splay tree.

A skip list.
Chapter 4

An interval tree.

A segment tree.

A weighted sum of intervals tree.

A weighted sum of intervals tree that supports intervalmaximum queries.

An orthogonal range tree.
Chapter 5

A search tree used as heap.

An arraybased heap.

A leftist heap.

A skew heap.

A binomial heap.

A Fibonacci heap.

A Minqueue.
Chapter 6

An amortized optimal unionfind structure.

A worstcase optimal unionfind structure.

A lcafind structure.
Chapter 8

A Trie with array nodes.

A Trie with list nodes.

A Trie with alphabet reduction.
Chapter 9

A hash table for integers with a universal hash function.

A hash table for strings with a universal hash function.

A perfect hash table for integers.