Question: (b) i) What is a queue? (2 marks) ii) Write the class interface for a node and for a queue using the predefined node
(b) i) What is a queue? (2 marks) ii) Write the class interface for a node and for a queue using the predefined node in C++. (8 marks) (c) A linked list may be represented as follows: value next value xt value, next value next Head 15 19 25 30 mull The list starts with a pointer Head, which points to the first node and the next field of each node points to the next node. Diagrammatically show the steps i) to add a node at the beginning of the list. ii) to add a node at the end of the list. iii) to add a node in between two nodes. (6 marks)
Step by Step Solution
3.47 Rating (163 Votes )
There are 3 Steps involved in it
In a que data structure maintain two pointers front and rear The front points to the first item of t... View full answer
Get step-by-step solutions from verified subject matter experts
