By Topic
- All Problems
- math (282)
- matrix-exponentiation (188)
- implementation (121)
- strings (103)
- combinatorics (93)
- dp (87)
- graphs (70)
- kmp (55)
- sorting (49)
- digit-dp (35)
- number-theory (34)
- prefix-sums (32)
- greedy (32)
- games (24)
- two-pointers (24)
- bitwise (23)
- binary-search (22)
- geometry (21)
- segment-tree (15)
- trees (15)
- bfs (14)
- aho-corasick (13)
- stack (11)
- sliding-window (10)
- game-theory (9)
- union-find (9)
- grundy (8)
- intervals (8)
- fenwick (7)
- heap (7)
- sparse-table (5)
- prefix-sum (5)
- interval-dp (5)
- suffix-array (4)
- linear-algebra (4)
- lazy-propagation (4)
- binary-lifting (4)
- bitmask (4)
- divide-and-conquer (4)
- offline (3)
- scc (3)
- shortest-paths (3)
- euler-tour (2)
- deque (2)
- manacher (2)
- mobius (2)
- nim (1)
- constructive (1)
- trie (1)
- sweep-line (1)
- brute-force (1)
- rerooting (1)
- pollard-rho (1)
- hashing (1)
- 2-sat (1)
- matching (1)
- knapsack (1)
- flow (1)
By Difficulty
Daily Challenge:
Paths Around the Walls
(1500)
Solve it to start a streak
trees Problems
15 practice problems tagged trees , from difficulty 1100 to 2100 — solve them in our in-browser judge with instant verdicts. Browse all problems.
Related: dp binary-lifting bfs graphs rerooting fenwick euler-tour
| Problem | Topics | Solvers | Acceptance | Difficulty | |
|---|---|---|---|---|---|
| Count the Leaves | trees | 0 | — | 1100 | |
| Height of the Tree | bfs trees | 0 | — | 1200 | |
| Tree or Not | graphs trees | 0 | — | 1300 | |
| Total Depth | trees | 0 | — | 1300 | |
| Largest Proper Subtree | trees | 0 | — | 1500 | |
| Lowest Common Ancestor | trees | 0 | — | 1500 | |
| Diameter of a Tree | bfs trees | 0 | — | 1600 | |
| No Two Neighbours Chosen | dp trees | 0 | — | 1700 | |
| K Generations Up | trees binary-lifting | 0 | — | 1800 | |
| The Centroid | dp trees | 0 | — | 1800 | |
| Distances at Scale | trees binary-lifting | 0 | — | 1900 | |
| Departments and Budgets | fenwick trees euler-tour | 0 | — | 2000 | |
| Tree Paths of Length K | dp trees | 0 | — | 2000 | |
| Everyone's Total Commute | dp trees rerooting | 0 | — | 2100 | |
| Worst Bridge on the Way | trees binary-lifting | 0 | — | 2100 |