Home /
Expert Answers /
Computer Science /
1-a-provide-a-partial-linked-list-implementation-in-java-of-a-stack-showing-the-data-structure-pa849
(Solved):
1. (a) Provide a partial linked list implementation in Java of a Stack, showing the data structure ...
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)