Section 24.5 Check Point Questions3 questions 

24.5.1
You can use inheritance or composition to design the data structures for stacks and queues. Discuss the pros and cons of these two approaches.
24.5.2
If LinkedList is replaced by ArrayList in lines 2-3 in LiveExample 24.6 GenericQueue.java, what will be the time complexity for the enqueue and dequeue methods?
24.5.3
Which lines of the following code are wrong?
1  List<String> list = new ArrayList<>();
2  list.add("Tom");
3  list = new LinkedList<>();
4  list.add("Tom");
5  list = new GenericStack<>();
6  list.add("Tom");