Practice Coding with 400+ Questions  (Part-4)


Topic -7 

BINARY TREES


  1. level order traversal
  2. Reverse Level Order traversal
  3. Height of a tree
  4. Diameter of a tree
  5. Mirror of a tree
  6. Left View of a tree
  7. Right View of Tree
  8. Top View of a tree
  9. Bottom View of a tree
  10. Zig-Zag traversal of a binary tree
  11. Check if a tree is balanced or not
  12. Diagonal Traversal of a Binary tree
  13. Boundary traversal of a Binary tree
  14. Construct Binary Tree from String with Bracket Representation
  15. Convert Binary tree into Doubly Linked List
  16. Convert Binary tree into Sum tree
  17. In-order Traversal of a tree both using recursion and Iteration
  18. Preorder Traversal of a tree both using recursion and Iteration
  19. Post-order Traversal of a tree both using recursion and Iteration
  20. Construct Binary tree from In-order and preorder traversal
  21. Find minimum swaps required to convert a Binary tree into BST
  22. Check if Binary tree is Sum tree or not
  23. Check if all leaf nodes are at same level or not
  24. Check if a Binary Tree contains duplicate subtrees of size 2 or more.
  25. Check if 2 trees are mirror or not
  26. Sum of Nodes on the Longest path from root to leaf node 
  27. Check if given graph is tree or not. 
  28. Find Largest subtree sum in a tree
  29. Maximum Sum of nodes in Binary tree such that no two are adjacent 
  30. Print all "K" Sum paths in a Binary tree
  31. Find LCA in a Binary tree
  32. Find distance between 2 nodes in a Binary tree
  33. Kth Ancestor of node in a Binary tree
  34. Find all Duplicate subtrees in a Binary tree.
  35. Tree Isomorphism Problem

Topic - 8 

BINARY SEARCH TREES

  1. Find a value in a BST
  2. Deletion of a node in a BST
  3. Find min and max value in a BST
  4. Find in-order successor and in-order predecessor in a BST
  5. Check if a tree is a BST or not 
  6. Populate In-order successor of all nodes
  7. Find LCA  of 2 nodes in a BST
  8. Construct BST from preorder traversal
  9. Convert Binary tree into BST
  10. Convert a normal BST into a Balanced BST
  11. ****Merge two BST****
  12. Find Kth largest element in a BST
  13. Find Kth smallest element in a BST
  14. Count pairs from 2 BST whose sum is equal to given value "X"
  15. Find the median of BST in O(n) time and O(1) space
  16. Count BST nodes that lie in a given range
  17. Replace every element with the least greater element on its right
  18. Given "n" appointments, find the conflicting appointments
  19. Check preorder is valid or not
  20. Check whether BST contains Dead end
  21. ****Largest BST in a Binary Tree ****
  22. Flatten BST to sorted list

Note - Questions in red are most Important ones and asked many times.

            Questions in BLUE are important Algorithms to be Considered.

** If having any sort of problems while Solving do let us know in the Comments Section Below**

ONLINE COMPILER ---



Link to part-1 : Take me to part-1

Link to part-2 : Take me to Part-2

Link to part-3 : Take me to part-3