Data Structures & Algorithms
237 notes
Some notes are currently available only in Chinese. English translations are shown when available.
- 1.1 Data Structures and Algorithmshistorical
Learning data structures and algorithms starts with a programming language and practice with concrete problems. This page collects links to the related notes.
- 2.1 arrayhistorical
A dynamic array tracks its length and capacity on top of a fixed-size array, expanding when space runs out. The notes include its structure, API, and implementation.
- 2.2 hashmaphistorical
A map associates keys with values. These notes compare search-tree and hash-table implementations, including hashing, collision handling, and resizing.
- 2.3 linkedlisthistorical
Arrays support indexed access, while linked lists insert and remove elements by changing links. These notes implement singly and doubly linked lists with APIs and test examples.
- 2.4 queuehistorical
A queue stores and retrieves elements in first-in, first-out order. These notes cover ordinary and circular queues with their structures, APIs, and implementations.
- 2.5 sethistorical
A set stores distinct elements. These notes implement a set using a hash map, with its data structure, API, and test examples.
- 2.6 stackhistorical
A stack retrieves elements in last-in, first-out order and can be implemented with a dynamic array or linked list. The notes include its API, implementation, and test examples.
- 2.7 treehistorical
Each binary-tree node has at most two children. These notes introduce common operations through preorder, inorder, postorder, and level-order traversal.
- 2.8 Red-Black Treehistorical
A red-black tree is a balanced binary search tree that maintains balance through node colors and structural rules. These notes introduce its five properties.
- 2.9 Skip Listhistorical
A skip list adds multiple levels of index links to a linked list, trading extra space for faster search. The bottom level holds all elements, while higher levels narrow the search.