Data Structures & Algorithms
237 notes
Some notes are currently available only in Chinese. English translations are shown when available.
- 2.10 heaphistorical
A heap is logically a tree that can be stored in an array. Max-heaps and min-heaps maintain order through parent-child value relationships.
- 2.11 BitMaphistorical
A bitmap records whether values exist using individual bits: 1 indicates presence and 0 indicates absence.
- 2.12 BloomFilterhistorical
BloomFilter: A website has 2 billion URLs in a blacklist. How should this blacklist be stored? If a URL is entered, how can we quickly determine whether it is in this blacklist, while keeping within a given memory limit such as 500 MB?
- 2.13 graphhistorical
A graph consists of vertices and edges. It may be directed or undirected, weighted or unweighted, and represented with an adjacency matrix or adjacency list.
- 2.14 UnionFindhistorical
Union-find represents connectivity with parent-linked trees. These notes work through Quick Find, Quick Union, and their optimizations.
- 2.15 LSMhistorical
An LSM tree, or log-structured merge-tree, serves write-heavy workloads by organizing and merging data around sequential disk writes.
- Longest Common Substringhistorical
Given two strings str1 and str2, return their longest common substring. The problem guarantees that the longest common substring of str1 and str2 exists and is unique.
- 2.16 ziplisthistorical
Ziplist is a compact data structure used inside Redis. These notes record its relationship to data types such as lists and sorted sets.
- Longest Common Subsequencehistorical
Given two strings text1 and text2, return the length of their longest common subsequence.
- 2.17 B Treehistorical
A B-tree is a balanced multiway search tree. These notes explain its structure and use cases through exact-match and range-query requirements.