Advanced patterns
Practice this questionWANT TO UNDERSTAND THE CONCEPT FIRST?Learn Advanced patterns
Monotonic stack
Used for nearest greater/smaller and histogram problems.
Trie
Used for dictionary and prefix matching.
Union-Find
Used for connectivity and grouping.
Segment tree
Used for range queries and updates.
Fenwick tree
Used for prefix sums and updates in O(log n).
Adapted from 14_DSA_MASTER.md · “16. Advanced patterns”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.