Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Design your own linked list class to hold any datatype. The class should have member functions for appending, inserting, and deleting nodes. Don't forget to
Design your own linked list class to hold any datatype. The class should have member functions for appending, inserting, and deleting nodes. Don't forget to add a destructor that destroys the list.
After creating the linked list class add member functions to do the following:
print The function should display all the values in the linked list.
reverse rearranges the nodes in the list so their order is reversed.
inserting a new item at a specified position. A position of means that the value willbecome the first item on the list, a position of means the value will become the second item on the list, and so on A position equal to or greater than the length of the list means the value is placed at the end of the list
a memberfunction for deleting a node at a specified position. A value of for the position means the first node in the list the current head is deleted. The function does nothing if the specified position is greater than or equal to the length of the list
an overloaded operator function This will give the linked list the ability to access nodes using a subscript, like an array. The subscript O will reference, the first node. in the list, the subscript will reference the second node in the list, and so forth. The subscript of the last node will be the number of nodes minus
Demonstrate the class with a driver program.
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