CoursesDSA Foundations

Tree Basics

Lessons
9
Exercises
57
Minutes
64

Start Binary Tree Structure

  1. 1

    Binary Tree Structure

    Nodes, children, roots, leaves, and the height of a binary tree.

    Complete codeDebugFill blankMultiple choiceTapTrace
    6 exercises
    6 min
  2. 2

    Empty Tree Base Case

    Apply recursion to trees by handling null nodes first.

    Complete codeDebugCode orderMultiple choiceTapTrace
    6 exercises
    7 min
  3. 3

    Depth-First Traversal

    Visit a tree recursively: pre-order, in-order, and post-order.

    Complete codeDebugCode orderMultiple choiceTapTrace
    6 exercises
    7 min
  4. 4

    Breadth-First Traversal

    Visit a tree level by level using a queue.

    Complete codeDebugCode orderMultiple choiceTapTrace
    6 exercises
    7 min
  5. 5

    Binary Search Tree Search

    Use the BST ordering property to find a value by going left or right.

    Complete codeDebugCode orderMultiple choiceTapTrace
    6 exercises
    7 min
  6. 6

    Maximum Depth

    Build the recursive solution for maximum depth of a binary tree.

    Complete codeDebugCode orderMultiple choiceTapTrace
    7 exercises
    8 min
  7. 7

    Tree Patterns CheckpointCheckpoint

    Combine tree structure, the null base case, DFS, BFS, BST search, and max depth — no new concepts.

    Complete codeDebugCode orderMultiple choiceTapTrace
    6 exercises
    6 min
  8. 8

    Tree Basics ReviewReview

    Revisit the whole island: traversal orders, the null base case, BFS, BST search, and depth.

    DebugCode orderFill blankMultiple choiceTapTrace
    6 exercises
    6 min
  9. 9

    Boss Battle: Maximum DepthBoss

    Solve Maximum Depth of Binary Tree using guided mobile-friendly steps.

    Complete codeDebugCode orderMultiple choiceTrace
    8 exercises
    10 min