Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please complete the Linked List data structure in C++ You are to write three separate programs, one each for stacks, queues, and linked-lists that support
please complete the Linked List 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)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started