Question: Please only complete the Queue data structure in C++ You are to write three separate programs, one each for stacks, queues, and linked-lists that support
Please only complete the Queue data structure in C++
You are to write three separate programs, one each for stacks, queues, and linked-lists that support the following operations for each data structure in question. Each of your program should include a class definition for "Node" (or chunk), a class definition for the data structure (stack/queue/LL) as well as a main function that should give a "menu" like interface to call the various functions. This "menu" like interface can be easily acheived with a "while(1)" loop and a "switch" statement nested within it, like we did in the last lecture. You can use the stack code we did in class as a reference to finish the rest. Functions required for each data structure: 1. Linked list: insertAtHead(int value) Hint: Similar to Stacks, insert at position 1 insertAtPosition(int position, int value) Hint: This should insert a node with value at any position in the list as long as that position is valid removeFromPosition(int position) Hint: Similar to insert above, this should remove a node from a list as long as position is valid - displayContents0) 2. Stacks: push(int value) -pop) displayContents) 3. Queues: enqueue(int value) - dequeue) printContents0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
