Trees coding problems

Tree problems build recursion and traversal skills: depth, diameter, paths, lowest common ancestor and level-order views, all common in product-company interviews.

20 problems: 11 easy, 9 medium, 0 hard. Free to read; a free account solves them and earns XP and Aura.

  1. Count Nodes at Depth KPractice · +10 XPeasy
  2. Count Nodes Greater Than ParentPractice · +10 XPeasy
  3. Count Tree EdgesPractice · +10 XPeasy
  4. Find Root of TreePractice · +10 XPeasy
  5. Leaf CountPractice · +10 XPeasy
  6. Parent Array RootPractice · +10 XPeasy
  7. Print Tree LevelsPractice · +10 XPeasy
  8. Root to Leaf Path SumPractice · +10 XPeasy
  9. Sum of Subtree SizesPractice · +10 XPeasy
  10. Tree Depth SumPractice · +10 XPeasy
  11. Tree Path SumPractice · +10 XPeasy
  12. Find Bridges in a TreePractice · +20 XPmedium
  13. Find Longest Path to LeafPractice · +20 XPmedium
  14. Find Minimum Depth Binary TreePractice · +20 XPmedium
  15. Maximum Depth Path SumPractice · +20 XPmedium
  16. Maximum Depth Sum of Unique PathsPractice · +20 XPmedium
  17. Tree Ancestor SumPractice · +20 XPmedium
  18. Tree Diameter and CenterPractice · +20 XPmedium
  19. Tree Path CountPractice · +20 XPmedium
  20. Tree Subtree SumsPractice · +20 XPmedium