# Binary Trees

## Types of techniques:

1. Depth First Search
   1. [pre-order-traversal](https://chkrishnatej.gitbook.io/interview-prep/trees/depth-first-search-dfs/pre-order-traversal "mention")
   2. [inorder-traversal](https://chkrishnatej.gitbook.io/interview-prep/trees/depth-first-search-dfs/inorder-traversal "mention")
   3. [post-order-traversal](https://chkrishnatej.gitbook.io/interview-prep/trees/depth-first-search-dfs/post-order-traversal "mention")
2. Height of the tree
3. Maximum Width/ Diamater of tree
   1. Handling binary tree problems with imaginary node by indexing&#x20;
   2. Counting Nodes
4. Lowest Common Ancestor (LCA)
5. Path Sum
6. Children Sum Property
7. Breadth First Search
   1. [breadth-first-search-bfs](https://chkrishnatej.gitbook.io/interview-prep/trees/breadth-first-search-bfs "mention")
   2. [left-side-view](https://chkrishnatej.gitbook.io/interview-prep/trees/binary-trees/binary-tree-views/left-side-view "mention")
   3. [right-side-view](https://chkrishnatej.gitbook.io/interview-prep/trees/binary-trees/binary-tree-views/right-side-view "mention")
   4. BFS with parent node
      1. Nodes at Distance K
      2. Time taken to infect
8. [boundary-view](https://chkrishnatej.gitbook.io/interview-prep/trees/binary-trees/binary-tree-views/boundary-view "mention")
9. Vertical Order Traversal
   1. [top-view](https://chkrishnatej.gitbook.io/interview-prep/trees/binary-trees/binary-tree-views/top-view "mention")
   2. [bottom-view](https://chkrishnatej.gitbook.io/interview-prep/trees/binary-trees/binary-tree-views/bottom-view "mention")
10. Symmetrics / Mirror Like Binary Trees
11. Constructing Unique Binary Tree
    1. [construct-binary-tree-based-on-inorder-and-preorder](https://chkrishnatej.gitbook.io/interview-prep/trees/binary-trees/construct-binary-tree-based-on-inorder-and-preorder "mention")
    2. [construct-binary-tree-based-on-inorder-and-postorder](https://chkrishnatej.gitbook.io/interview-prep/trees/binary-trees/construct-binary-tree-based-on-inorder-and-postorder "mention")
    3. <mark style="background-color:orange;">**NOTE:**</mark> <mark style="background-color:orange;"></mark><mark style="background-color:orange;">Cannot construct BT based on only preorder and postorder</mark>

## Bookmarks

* <https://leetcode.com/discuss/general-discussion/937307/iterative-recursive-dfs-bfs-tree-traversal-in-pre-post-levelorder-views>
