Skip to content

Latest commit

 

History

History
76 lines (64 loc) · 3.39 KB

File metadata and controls

76 lines (64 loc) · 3.39 KB

Trees

Binary trees, binary search trees, and tree traversal problems.

Key Concepts Covered

  • Tree traversals (inorder, preorder, postorder, level-order)
  • Binary Search Tree (BST) operations
  • Tree construction from traversals
  • Lowest Common Ancestor (LCA)
  • Tree diameter and height
  • Binary lifting
  • Morris traversal (O(1) space)
  • Tree views (left, right, vertical)
  • Balanced trees

Problems in this Directory

Tree Traversals

Tree Properties

Lowest Common Ancestor (LCA)

Tree Views

Tree Construction

Binary Search Tree (BST)

Binary Lifting & Advanced

Special Problems

Tips

  • Master recursion for tree problems
  • Use NULL checks to avoid segfaults
  • Draw trees while solving
  • Remember: Inorder of BST is sorted
  • Practice both recursive and iterative approaches