Amazon Placement Paper - 3


1. Given a dictionary with limited words. Check if the string given to you is a composite of two words which are already present in the dictionary.

2. Given a single linked list of certain nodes. Switch adjacent nodes. Eg. 1 2 3 4 will be 2 1 4 3.

3. What is the function of the 'finally' block in java ? Under what conditions does the finally block not get executed, if this is possible?

4. Display all the nodes at the same level in a tree.

5. Given a binary search tree. Traverse only the left sub-tree.

6. Given a n-ary tree. Devise an algo which determines the position at which the 3rd b is present from the given index in constant time complexity.

7. What is hashing. What is constant time complexity?

8. Which are the data structures which have constant time complexity. Hint - they both use indexes?

9. The preprocessor method will use what data structures to ensure the geta() or getb() function will determine the 3rd b's position in constant time complexity.

10. Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not ?

11. Implementation of avl tree.

S