GsFGs important questions


1. Reverse stack using only push(), pop() and isempty():

2. Backtracking: Tug of war:

3. Permutations of a string:

Linked Lists:

1. 3 sum problem (from 3 diff linked lists):


1. Find a pair with given sum in BST:

2. Morris Traversal:


3. BST from preorder:

4. Boundary traversal Binary Tree:

5. Parallel inorder search:

6. Find largest BST in a tree:


b. [Prefer]

7.Check if a binary tree is sum tree:

8. Print BST keys in a given range:

9. Get the level of a node: (Important, also used in printing all nodes at a distance k from root)

10. Sorted order printing of an array:

11. 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))


Leave a comment

Filed under Algorithms

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s