# Tag Archives: book

## GsFGs important questions

Recursion:

1. Reverse stack using only push(), pop() and isempty(): http://www.geeksforgeeks.org/reverse-a-stack-using-recursion/

2. Backtracking: Tug of war: http://www.geeksforgeeks.org/tug-of-war/

3. Permutations of a string: http://www.geeksforgeeks.org/write-a-c-program-to-print-all-permutations-of-a-given-string/

Trees:

1. Find a pair with given sum in BST: http://www.geeksforgeeks.org/find-a-pair-with-given-sum-in-bst/

2. Morris Traversal: http://www.geeksforgeeks.org/morris-traversal-for-preorder/

3. BST from preorder: http://www.geeksforgeeks.org/construct-bst-from-given-preorder-traversal-set-2/

4. Boundary traversal Binary Tree: http://www.geeksforgeeks.org/boundary-traversal-of-binary-tree/

5. Parallel inorder search: http://www.geeksforgeeks.org/merge-two-bsts-with-limited-extra-space/

6. Find largest BST in a tree:

7.Check if a binary tree is sum tree: http://www.geeksforgeeks.org/check-if-a-given-binary-tree-is-sumtree/

8. Print BST keys in a given range: http://www.geeksforgeeks.org/print-bst-keys-in-the-given-range/

9. Get the level of a node: http://www.geeksforgeeks.org/get-level-of-a-node-in-a-binary-tree/ (Important, also used in printing all nodes at a distance k from root)

10. Sorted order printing of an array: http://www.geeksforgeeks.org/sorted-order-printing-of-an-array-that-represents-a-bst/

11. Root to leaf path sum equal to a given number: http://www.geeksforgeeks.org/root-to-leaf-path-sum-equal-to-a-given-number/ (important to know how to return bool)

12. Level order in spiral (using recursion, complexity is O(n^2)) http://www.geeksforgeeks.org/level-order-traversal-in-spiral-form/