Skip to content
Varma Penmetsa edited this page Sep 5, 2018 · 15 revisions

Binary Tree

Traversal:

  1. BFS Traversal
  2. DFS Traversal
  3. InOrder Iterative
  4. PreOrder Iterative
  5. PostOrder Iterative
  6. InOrder/PreOrder Morris Traversal
  7. Print LevelOrder LineByLine
  8. Reverse LevelOrder Traversal
  9. Diameter of Binary Tree (To Do)

Construction:

  1. Construct a tree given in-order and preorder traversal
  2. Construct a binary tree give preorder and postorder
  3. Construct a tree from In-order and Level order traversals (To Do)
  4. Construct Complete binary from a Linked List
  5. Construct Special Binary Tree from given In-order traversal
  6. Construct Binary Tree from String with bracket representation (To Do)
  7. Convert a given Binary Tree to Doubly Linked List (To Do)

Checking:

  1. Check for Children Sum Property in a Binary Tree
  2. Check if a given Binary Tree is SumTree
  3. Check sum of Covered and Uncovered nodes of Binary Tree (Revise Sum method)
  4. Check if two nodes are cousins in a Binary Tree (Revise getParent method)
  5. Check if removing an edge can divide a Binary Tree in two halves (Revise size method)
  6. Check if a binary tree is subtree of another binary tree(Revise isSame function)
  7. Check if Binary Tree is Full Binary Tree
  8. Check if Binary Tree is Perfect Binary Tree(Revise depth function)
  9. Print all root to leaf paths with there relative positions (To Do)
  10. Check if there is a root to leaf path with given sequence
  11. Check if root to leaf path sum equal to a given number
  12. Given a binary tree, print out all of its root-to-leaf paths one per line (To Do)
  13. Lowest Common Ancestor in a Binary Tree
  14. Find the distance between two keys in a binary tree (Revise distanceFromRoot2Node)
  15. Print Binary from Side, Up, Bottom, Right view (To Do)
  16. Print Binary Tree in Spiral Order (To Do)

Binary Search Tree

  1. Search in BST
  2. Construct BST given preorder traversal
  3. LCA of BST
  4. Check if Binary tree is a BST

Clone this wiki locally