Courses

Trees & Graphs

Traverse everything connected: tree DFS and BFS, grid flood fill, graph fundamentals, topological order, shortest paths, and tries.

Islands
7
Lessons
63
Exercises
398
Complete codeDebugCode orderFill blankMultiple choiceTapTrace
  1. Island 1

    Tree DFS

    1. Go Deep First6 exercises, 5 min
    2. Invert Binary Tree6 exercises, 6 min
    3. Path Sum7 exercises, 7 min
    4. Diameter of Binary Tree6 exercises, 7 min
    5. LCA of a BST6 exercises, 6 min
    6. Kth Smallest in a BST6 exercises, 7 min
    7. Tree DFS CheckpointCheckpoint6 exercises, 7 min
    8. Tree DFS ReviewReview6 exercises, 6 min
    9. Boss: Validate Binary Search TreeBoss8 exercises, 10 min
  2. Island 2

    Tree BFS

    1. Breadth-First Search6 exercises, 5 min
    2. Average of Levels6 exercises, 6 min
    3. Level Order Traversal6 exercises, 7 min
    4. Cousins in Binary Tree6 exercises, 6 min
    5. Binary Tree Right Side View6 exercises, 7 min
    6. Maximum Level Sum of a Binary Tree6 exercises, 6 min
    7. Tree BFS CheckpointCheckpoint6 exercises, 7 min
    8. Tree BFS ReviewReview6 exercises, 6 min
    9. Boss: Zigzag Level OrderBoss8 exercises, 10 min
    1. Grids Are Graphs6 exercises, 5 min
    2. Flood Fill6 exercises, 6 min
    3. Number of Islands6 exercises, 7 min
    4. Max Area of Island6 exercises, 6 min
    5. Surrounded Regions6 exercises, 7 min
    6. 01 Matrix6 exercises, 7 min
    7. Grid Traversal CheckpointCheckpoint6 exercises, 7 min
    8. Grid Traversal ReviewReview6 exercises, 6 min
    9. Boss: Rotting OrangesBoss8 exercises, 10 min
    1. Nodes, Edges, and the Visited Set6 exercises, 5 min
    2. Find Center of Star Graph6 exercises, 5 min
    3. Find the Town Judge6 exercises, 6 min
    4. Find if Path Exists in Graph6 exercises, 6 min
    5. Keys and Rooms6 exercises, 6 min
    6. All Paths From Source to Target7 exercises, 7 min
    7. Graph Foundations CheckpointCheckpoint6 exercises, 7 min
    8. Graph Foundations ReviewReview6 exercises, 6 min
    9. Boss: Clone GraphBoss8 exercises, 10 min
    1. In-Degrees and Kahn's Peel6 exercises, 5 min
    2. Minimum Vertices to Reach All Nodes6 exercises, 6 min
    3. Find All Possible Recipes7 exercises, 7 min
    4. Course Schedule IV6 exercises, 7 min
    5. All Ancestors of a Node in a DAG7 exercises, 7 min
    6. Find Eventual Safe States6 exercises, 7 min
    7. Topological Sort CheckpointCheckpoint6 exercises, 7 min
    8. Topological Sort ReviewReview6 exercises, 6 min
    9. Boss: Course ScheduleBoss8 exercises, 10 min
    1. When BFS Isn't Enough6 exercises, 5 min
    2. Shortest Path in Binary Matrix6 exercises, 6 min
    3. Shortest Path with Alternating Colors6 exercises, 7 min
    4. Path with Maximum Probability6 exercises, 7 min
    5. Path With Minimum Effort6 exercises, 7 min
    6. Cheapest Flights Within K Stops6 exercises, 7 min
    7. Shortest Paths CheckpointCheckpoint6 exercises, 7 min
    8. Shortest Paths ReviewReview6 exercises, 6 min
    9. Boss: Network Delay TimeBoss8 exercises, 10 min
  3. Island 7

    Tries

    1. Letters as Edges6 exercises, 5 min
    2. Longest Common Prefix7 exercises, 6 min
    3. Implement Trie (Prefix Tree)7 exercises, 7 min
    4. Replace Words6 exercises, 6 min
    5. Longest Word in Dictionary6 exercises, 7 min
    6. Search Suggestions System6 exercises, 7 min
    7. Tries CheckpointCheckpoint6 exercises, 7 min
    8. Tries ReviewReview6 exercises, 6 min
    9. Boss: Add and Search WordsBoss8 exercises, 10 min
AlgoFox Pro

Trees & Graphs is part of AlgoFox Pro

You can read the whole course outline here. The exercises are in the app, along with your streak, your mistake review, and the progress that carries across your devices.

Pro starts with a 3 day free trial. The app store decides who is eligible for an introductory offer, and a lapsed subscription does not get another one.

Download AlgoFox on the App StoreGet AlgoFox on Google Play

Already subscribed in the app? Sign in with the same account and Pro works here too. Quick Play and Battle are free on the web, and so is the first course in every subject.