Concepts3
πTheoryIntermediate
Amortized Analysis
Amortized analysis measures the average cost per operation over a worst-case sequence, not over random inputs.
#amortized analysis#aggregate method#accounting method+12
βοΈAlgorithmIntermediate
Minimum Spanning Tree - Kruskal
Kruskalβs algorithm builds a minimum spanning tree (MST) by sorting all edges by weight and greedily picking the next lightest edge that does not form a cycle.
#kruskal#minimum spanning tree#mst+11
ποΈData StructureIntermediate
Rollback DSU
Rollback DSU (Disjoint Set Union with undo) lets you union sets and later revert to any previous state in LIFO order.
#rollback dsu#dsu with undo#union find+11