1. How do you implement a stack by using an array?
2. A binary tree is of height K and has N leaf nodes on it. What are the maximum and minimum possible values of N in terms of K? Would your answer be any different if the tree was a binary search tree?
3. What is an in-place algorithm? Can you give an example?
4. What can you say about the following statement? Is it any necessary to obey this rule?
5. What is a collision? What happens when there is a collision in HashMap?
6. Can you store a duplicate Value in a <Key,Value> entry pair of HashMap?
7. What is the difference between binary tree and balanced binary tree?
8. Can you store a duplicate key in `HashMap`?
9. Which of the following 3 data structures is more memory efficient than the others - HashMap, ArrayList, LinkedList?
10. What are the elements in `myStack` after the following code is executed?
11. Which of the following Java data structure(s) are backed by an array - LinkedList, ArrayList, HashMap?
12. Which of the following computational complexities are polynomial - O(1/n), O(n!), O(n^2), O(log n), O(2^n), O(n^n)?
13. You will be using a data structure to store sorted integers and conduct binary search on them. Which of the following would you use and why: ArrayList, LinkedList, or HashSet?
14. When do you prefer to use TreeSet over HashSet? Explain.
15. What are the basic interfaces of Java Collections framework?
16. Suppose you have the following array of length 16. How would you increase the array's length to 32?
17. What does the following method do? Can you write it by using an array instead of a HashSet?
18. What does `myMethod` do? Can you write its non-recursive version?
19. Suppose T is a full tree. Which of Depth-First Search (DFS) and Breadth-First Search (BFS) algorithms traverse a leaf of T soonest?
20. What is the complexity of an optimum algorithm to sort `n` integer values that are greater than 0 and l*ess than 100?
21. What is the complexity of an optimum algorithm to sort `n` arbitrary integer values?
22. Write a recursive method that returns true if the entries of a character array (char[]) constitute a palindrome, false otherwise.
23. What is the computational complexity of `contains()` operation (checking whether it contains an object among its elements) on an `ArrayList`? Would your answer be any different for a `LinkedList`?
24. Which of the following two operations are faster in a LinkedList than on a TreeSet - `add(int)`, `contains(Object)`, `remove(Object)`? Explain why.
25. Suppose `aColln` is a collection with the following two integers in it: 5, 7. How many elements are there in `mySet` and `myList` after the following code is executed?
26. How many different paths can exist between a pair of nodes in a binary tree?
27. Which of the following 4 operations is faster on a HashSet<String> than on a LinkedList<String>?
28. What is the computational complexity of get(int) operation (accessing an array element by its position) on an `ArrayList`? Would your answer be any different for a `LinkedList`?
29. What is the difference between a binary tree and a binary search tree?
30. Take the following code: How many entries are there in myMap after this code is executed?