0

Trees

Recursive structure where almost every solution is solve the children, then combine.

Newinterview weight 9035 problems2 visualisers
18
mastery
Attempts logged
0
Predicted success on the next one
33%
Solved here
0 / 35

What you actually need to hold in your head

  • Pre, in and post order are one walk with different visit times
  • BFS by level with a queue
  • Return more than one value to the parent
  • Height, diameter and path sums are all post-order

Watch it run

Step through the algorithm before you write it.

Patterns in this topic

The trigger phrases are what you are training yourself to notice.

Trees problems

Ordered by sheet phase, so the early ones are the highest signal.

0 / 35 solved
1
2
3
4
5
7
ETrees
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
25
26
27
28
29
30
31
32
33
34
35