inversion counting Link to heading
quick select and kth smallest and/or largest Link to heading
when asking kth smallest and/or largest questions, and ask for time complexity less than O(nlogn), must be quickselect.
topological sort Link to heading
union find Link to heading
Union-Find is a data structure that can keep track of a set of elements partitioned into a number of disjoint (non-overlapping) subsets. It is also known as disjoint-set data structure.
it supports 3 operations:
- find()
- union(a, b)
- addset(a)