DSA Factory
Curriculum
Level 3 · Structures

Trees

About 35 steps, from the first idea to a mastery test.

  1. Stage 0Nodes and depthFree
    1. 1Count the nodes8 min
    2. 2Maximum depth8 min
    3. 3Search a binary tree8 min
    4. 4Same tree9 min
  2. Stage 1TraversalsFree
    1. 1Preorder traversal8 min
    2. 2Inorder traversal8 min
    3. 3Postorder traversal8 min
    4. 4Iterative inorder traversal12 min
  3. Stage 2Level orderFree
    1. 1Read the tree row by row14 min
    2. 2Zigzag through the rows12 min
    3. 3The biggest value in each row12 min
    4. 4Is the tree filled without gaps14 min
  4. Stage 3PathsFree
    1. 1Walk down to a leaf with a target12 min
    2. 2List every route from the top14 min
    3. 3Paths that start anywhere20 min
    4. 4The best path anywhere22 min
  5. Stage 4Building and comparingFree
    1. 1Rebuild a tree from two walks20 min
    2. 2A balanced tree from a sorted list14 min
    3. 3Is one tree inside another14 min
    4. 4Lay one tree over the other12 min
  6. Stage 5AncestorsFree
    1. 1Where two branches meet18 min
    2. 2Use the order to find the meeting point12 min
    3. 3Steps between two nodes14 min
    4. 4The ring around a node20 min
  7. Stage 6Views and widthsFree
    1. 1What you see from the right12 min
    2. 2Column by column14 min
    3. 3The widest row, gaps included20 min
    4. 4Looking from above14 min
  8. Stage 7SerializeFree
    1. 1Write a tree down as text12 min
    2. 2Read the text back into a tree14 min
    3. 3Spot the twin subtrees20 min
    4. 4How many different trees16 min
  9. Stage 8MasteryFree
    1. 1Watching every branch22 min
    2. 2Robbing the tree20 min
    3. 3The best search subtree24 min
Start freeTry a step first