Skip to content
Avio Lines
D14

Trees

64 stations · 23h

Binary tree traversals, views, LCA and path problems. 64 interview problems explained by codestorywithMIK (23h of video), grouped into 8 patterns such as Traversals (DFS / BFS), Height, Depth & Diameter, Root-to-Leaf Paths.

Start this line →
problems by zone (pattern)
  • Traversals (DFS / BFS)22
  • Height, Depth & Diameter5
  • Root-to-Leaf Paths7
  • LCA & Ancestors3
  • Construction & Serialization6
  • Tree Modification4
  • Tree as Graph17
  • General Recursion on Trees33
  1. Traversals (DFS / BFS)

    0 of 22 passed
  2. MediumGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
  3. MediumGoogle · Amazon · +13 more companiesLeetCode ↗ (opens in a new tab)
  4. MediumGoogle · Amazon · +6 more companiesLeetCode ↗ (opens in a new tab)
  5. MediumGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
  6. MediumGoogle · Meta · +1 more companiesLeetCode ↗ (opens in a new tab)
  7. MediumGoogle · Amazon · +6 more companiesLeetCode ↗ (opens in a new tab)
  8. EasyGoogle · Amazon · +5 more companiesLeetCode ↗ (opens in a new tab)
  9. MediumGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
  10. Even Odd TreeLC 1609 · 40:37
    MediumAmazon · Meta · +1 more companiesLeetCode ↗ (opens in a new tab)
  11. MediumGoogle · josh technologyLeetCode ↗ (opens in a new tab)
  12. HardGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
  13. Height, Depth & Diameter

    0 of 5 passed
  14. EasyGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
  15. EasyGoogle · Amazon · +18 more companiesLeetCode ↗ (opens in a new tab)
  16. Balanced Binary TreeLC 110 · 16:45
    EasyGoogle · Amazon · +6 more companiesLeetCode ↗ (opens in a new tab)
  17. Root-to-Leaf Paths

    0 of 7 passed
  18. Path Sum IILC 113 · 12:38
    MediumGoogle · Amazon · +8 more companiesLeetCode ↗ (opens in a new tab)
  19. MediumGoogle · Amazon · +5 more companiesLeetCode ↗ (opens in a new tab)
  20. EasyGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
  21. LCA & Ancestors

    0 of 3 passed
  22. MediumGoogle · Amazon · +20 more companiesLeetCode ↗ (opens in a new tab)
  23. MediumAmazon · Meta · +3 more companiesLeetCode ↗ (opens in a new tab)
  24. MediumGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
  25. Construction & Serialization

    0 of 6 passed
  26. MediumGoogle · Amazon · +5 more companiesLeetCode ↗ (opens in a new tab)
  27. HardGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
  28. Tree Modification

    0 of 4 passed
  29. MediumGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
  30. Add One Row to TreeLC 623 · 15:08
    MediumGoogle · BloombergLeetCode ↗ (opens in a new tab)
  31. MediumGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
  32. MediumGoogle · Amazon · +1 more companiesLeetCode ↗ (opens in a new tab)
  33. Tree as Graph

    0 of 17 passed
  34. MediumGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
  35. MediumGoogle · Amazon · +6 more companiesLeetCode ↗ (opens in a new tab)
  36. MediumGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
  37. MediumGoogle · Amazon · +16 more companiesLeetCode ↗ (opens in a new tab)
  38. MediumGoogle · Meta · +1 more companiesLeetCode ↗ (opens in a new tab)
  39. MediumGoogle · Amazon · +6 more companiesLeetCode ↗ (opens in a new tab)
  40. MediumGoogle · Amazon · +11 more companiesLeetCode ↗ (opens in a new tab)
  41. MediumGoogle · Amazon · +11 more companiesLeetCode ↗ (opens in a new tab)
  42. MediumGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
  43. Even Odd TreeLC 1609 · 40:37
    MediumAmazon · Meta · +1 more companiesLeetCode ↗ (opens in a new tab)
  44. MediumGoogle · josh technologyLeetCode ↗ (opens in a new tab)
  45. General Recursion on Trees

    0 of 33 passed
  46. MediumGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
  47. Find Leaves Of Binary TreeLC 366 · 17:45 · LeetCode Premium
    MediumGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
  48. Binary Tree PruningLC 814 · 16:48
    MediumGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
  49. Leaf-Similar TreesLC 872 · 8:08
    EasyGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
  50. MediumGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
  51. Same TreeLC 100 · 14:18
    EasyGoogle · Amazon · +7 more companiesLeetCode ↗ (opens in a new tab)
  52. MediumGoogle · Amazon · +5 more companiesLeetCode ↗ (opens in a new tab)
  53. MediumGoogle · Amazon · +6 more companiesLeetCode ↗ (opens in a new tab)
  54. MediumGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
  55. MediumGoogle · Meta · +1 more companiesLeetCode ↗ (opens in a new tab)
  56. MediumGoogle · Amazon · +6 more companiesLeetCode ↗ (opens in a new tab)
  57. MediumGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
  58. MediumGoogle · Amazon · +5 more companiesLeetCode ↗ (opens in a new tab)
  59. MediumGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
  60. MediumGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
  61. MediumGoogle · TikTok · +1 more companiesLeetCode ↗ (opens in a new tab)
  62. MediumGoogle · TikTok · +1 more companiesLeetCode ↗ (opens in a new tab)
  63. MediumGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
  64. MediumGoogle · josh technologyLeetCode ↗ (opens in a new tab)
  65. MediumGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
  66. Sum of Left LeavesLC 404 · 19:49
    EasyGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
  67. EasyGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)

All 64 stations in order

  1. 1.Construct Quad Tree (Leetcode - 427) - (Google) : Explanation ➕ Live Coding (LeetCode 427)
  2. 2.Time Needed to Inform All Employees (LeetCode 1376)
  3. 3.Binary Tree Right Side View (LeetCode 199)
  4. 4.Binary Tree Right Side View (LeetCode 199)
  5. 5.Construct Binary Tree From Preorder And Inorder Traversal (LeetCode 105)
  6. 6.Lowest Common Ancestor of a Binary Tree (LeetCode 236)
  7. 7.Check Completeness of a Binary Tree (BFS) - (Meta, Amazon) : Explanation ➕ Live Coding (LeetCode 958)
  8. 8.Check Completeness of a Binary Tree (DFS) - (Meta, Amazon) : Explanation ➕ Live Coding (LeetCode 958)
  9. 9.Delete Nodes And Return Forest Solved (LeetCode 1110)
  10. 10.Find Leaves Of Binary Tree (LeetCode 366)
  11. 11.Binary Tree Pruning (LeetCode 814)
  12. 12.Binary Tree Pruning (O(n))- (Google, Amazon, Microsoft) : Explanation + Live Coding 🧑🏻‍💻👩🏻‍💻 (LeetCode 814)
  13. 13.Path Sum II (LeetCode 113)
  14. 14.Path Sum - (Amazon, Microsoft, Accolite, Adobe...) : Explanation + Live Coding 🧑🏻‍💻👩🏻‍💻 (LeetCode 112)
  15. 15.Add One Row to Tree (LeetCode 623)
  16. 16.Count Complete Tree Nodes -(Amazon, Microsoft, Salesforce, Meta) : Explanation ➕ Live Coding (LeetCode 222)
  17. 17.Leaf-Similar Trees (LeetCode 872)
  18. 18.Maximum Difference Between Node and Ancestor (LeetCode 1026)
  19. 19.Maximum Product of Splitted Binary Tree (LeetCode 1339)
  20. 20.Binary Tree Maximum Path Sum - (Google, Meta, Amazon, Flipkart) : Explanation ➕ Live Coding (LeetCode 124)
  21. 21.Binary Tree Preorder Traversal - (Microsoft, Walmart, Flipkart, Amazon) : Explanation ➕ Live Coding
  22. 22.Same Tree (LeetCode 100)
  23. 23.Find Duplicate Subtrees (Leetcode - 652) - (GOOGLE) : Explanation ➕ Live Coding (LeetCode 652)
  24. 24.Symmetric Tree (Leetcode - 101) - (Amazon, Microsoft, Mentor (Siemens)) : Explanation ➕ Live Coding (LeetCode 101)
  25. 25.Sum Root to Leaf Numbers (LeetCode 129)
  26. 26.Construct Binary Tree from Inorder and Postorder Traversal (LeetCode 106)
  27. 27.Longest ZigZag Path in a Binary Tree - (LeetCode 1372)
  28. 28.Maximum Width of Binary Tree (LeetCode 662)
  29. 29.Maximum Level Sum of a Binary Tree (LeetCode 1161)
  30. 30.Minimum Depth of Binary Tree (LeetCode 111)
  31. 31.All Nodes Distance K in Binary Tree (LeetCode 863)
  32. 32.Validate Binary Tree Nodes (LeetCode 1361)
  33. 33.Find Largest Value in Each Tree Row (LeetCode 515)
  34. 34.Count Nodes Equal to Average of Subtree (LeetCode 2265)
  35. 35.Binary Tree Inorder Traversal (LeetCode 94)
  36. 36.Amount of Time for Binary Tree to Be Infected (LeetCode 2385)
  37. 37.Amount of Time for Binary Tree to Be Infected (LeetCode 2385)
  38. 38.Distribute Coins in Binary Tree (LeetCode 979)
  39. 39.Paths from root with a specified sum
  40. 40.Pseudo-Palindromic Paths in a Binary Tree (LeetCode 1457)
  41. 41.Count the nodes at distance K from leaf
  42. 42.Diameter of Binary Tree (LeetCode 543)
  43. 43.Find Bottom Left Tree Value (LeetCode 513)
  44. 44.Even Odd Tree (LeetCode 1609)
  45. 45.Smallest String Starting From Leaf (LeetCode 988)
  46. 46.Delete Leaves With a Given Value (LeetCode 1325)
  47. 47.Create Binary Tree From Descriptions (LeetCode 2196)
  48. 48.Step-By-Step Directions From a Binary Tree Node to Another (LeetCode 2096)
  49. 49.Number of Good Leaf Nodes Pairs (LeetCode 1530)
  50. 50.Number of Good Leaf Nodes Pairs (LeetCode 1530)
  51. 51.Linked List in Binary Tree (LeetCode 1367)
  52. 52.Cousins in Binary Tree II (LeetCode 2641)
  53. 53.Flip Equivalent Binary Trees (LeetCode 951)
  54. 54.Height of Binary Tree After Subtree Removal Queries (LeetCode 2458)
  55. 55.Reverse Odd Levels of Binary Tree (LeetCode 2415)
  56. 56.Minimum Number of Operations to Sort a Binary Tree by Level (LeetCode 2471)
  57. 57.Find Elements in a Contaminated Binary Tree (LeetCode 1261)
  58. 58.Recover a Tree From Preorder Traversal (LeetCode 1028)
  59. 59.Construct Binary Tree from Preorder and Postorder Traversal (LeetCode 889)
  60. 60.Lowest Common Ancestor of Deepest Leaves (LeetCode 1123)
  61. 61.Sum of Left Leaves (LeetCode 404)
  62. 62.Evaluate Boolean Binary Tree (LeetCode 2331)
  63. 63.Balanced Binary Tree (LeetCode 110)
  64. 64.Sum of Root To Leaf Binary Numbers (LeetCode 1022)