1. Merge two sorted linked list so that the result is still sorted. For this problem, assume that you only have a Node class and thus you have to take care of all the details. Your function should look like: Node merge(Node lista, Node listb).
2. A list is a palindrome if it looks the same from both sides. For example, 1 2 3 2 1 is a palindrome. Checking the whether an array is a palindrome is simple, but for linked list the task is a bit harder. Write a function to check whether a linked list is a palindrome. you can change the linked list after the function returns.
3. Modify the stack class so that it supports the "max" operation. For install, for stack s, s.max() should give the largest element (assume it is integer) in the stack. Your implementation should be efficient. The max operation should be constant time (linear search through all the elements is not acceptable). You can use extra memory.
4. Repeat question 3, but this time with a queue.
5. Find the max element is each sliding window of an array. Given an array, e.g. 1 3 2 5 4, and a sliding window length 3, the max in each window is 3 5 5. Write a function to solve the problem. [Hint: use the queue in question 4].