titan2400

BinaryTree

Jul 13th, 2014
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. - InOrder Traversal -
  2. - PreOrder Traversal -
  3. - PostOrder Traversal -
  4. - LevelOrder Traversal -
  5. - Finding size of binary tree -
  6. - Finding sum of all elements in binary tree -
  7. - Finding height of binary tree -
  8. - Finding maximum element in a binary tree -
  9. - Finding deepest node of binary tree -
  10. - Finding number of leaves in binary tree -
  11. - Finding number of full nodes in a binary tree -
  12. - Finding number of half nodes in a binary tree -
  13. - Program to determine if two binary trees are identical -
  14. - Program to convert binary tree in to its mirror -
  15. - Program to determine if two binary trees are mirrors -
  16. - Program to print all ancestors of node in binary tree -
  17. - Finding diameter of binary tree
  18. - Given binary tree, print all root to leaf paths -
  19. - Finding the level with maximum sum in a binary tree -
  20. - ***Checking existence of path with given sum in a binary tree
  21. - Finding LCA of two nodes in Binary tree
  22. - ***Zigzag Tree Traversal
  23. - Program to delete a tree
  24. - Program to search an element
  25. - Given two traversal sequences, can we construct binary tree uniquely -------
  26. - ***Find the maximum sum leaf to root path in binary tree
  27. - ***Find the maximum path sum between two leaves of a binary tree
  28. - Check if given tree is subtree of another binary tree
  29. - Construct tree from given InOrder and PreOrder traversals
  30. - Link: http://www.geeksforgeeks.org/construct-tree-from-given-inorder-and-preorder-traversal/
  31. - Construct a tree given level order and InOrder traversals
  32. - Link: http://www.geeksforgeeks.org/construct-tree-inorder-level-order-traversals/
  33. - Program to delete an element from binary tree
  34. - Finding vertical sum of binary tree
  35.  
  36.  
  37. - ***The Great Tree-List Recursion Problem
  38. - Link: http://cslibrary.stanford.edu/109/TreeListRecursion.html
  39. - Problem Statement:
  40. Write a recursive function treeToList(Node root) that takes an ordered binary tree and rearranges
  41. the internal pointers to make a circular doubly linked list out of the tree nodes. The "previous"
  42. pointers should be stored in the "small" field and the "next" pointers should be stored in the
  43. "large" field. The list should be arranged so that the nodes are in increasing order.
  44. Return the head pointer to the new list. The operation can be done in O(n) time --
  45. essentially operating on each node once
Advertisement
Add Comment
Please, Sign In to add comment