- A Write A Class Called Hyprid That Uses Linked Lists To Represent A Queue And Stack As You Can Recall That The Only Di 1 (38.44 KiB) Viewed 23 times
a. Write a class called hyprid that uses linked lists to represent a queue and stack. As you can recall that the only di
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
a. Write a class called hyprid that uses linked lists to represent a queue and stack. As you can recall that the only di
a. Write a class called hyprid that uses linked lists to represent a queue and stack. As you can recall that the only difference in between the stack and the queue is that the stack uses the addHead method to push items and the queue uses the addTail method to insert items. The class should be implemented using Linked Lists. The class should contain the following methods: a. boolean empty() to check if the underlying list is empty b. void push(int item) to add the item using addFirst c. void insert (int item) to add the item using addLast d. int remove() to remove an item from the beginning of the list e. int pop() the same as above but with name changed