- 1 A Provide A Partial Linked List Implementation In Java Of A Stack Showing The Data Structures Involved And The Cla 1 (131.19 KiB) Viewed 65 times
1. (a) Provide a partial linked list implementation in Java of a Stack, showing the data structures involved and the cla
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
1. (a) Provide a partial linked list implementation in Java of a Stack, showing the data structures involved and the cla
1. (a) Provide a partial linked list implementation in Java of a Stack, showing the data structures involved and the class interface. You can leave out the definitions of the Stack methods. (8 marks) (b) With the aid of pointer diagrams, show how the pop() operation works on a Stack which has a linked list implementation. Treat the cases of a stack with one value and a stack with more than one value. Is there any difference? (7 marks) (c) Give the Java implementation of the method pop(). What is the complexity of pop() in big-Oh notation? (6 marks) (d) Using an example with diagrams, describe the alternative array implementation of a Stack. (6 marks) (e) Briefly describe two other abstract data types Queue and PQueue (priority queue), and outline the difference in the behaviour and complexity of their respective insert/remove operations. (6 marks)