Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Design your own linked list class to hold a series of integers. The class should have member functions for appending, inserting, and deleting nodes. Also,
Design your own linked list class to hold a series of integers.
- The class should have member functions for appending, inserting, and deleting nodes.
- Also, include a member function named search. The function should search the list for a specific value. If the value is found, it should return a member indicating its position in the list. (The first node 1, the second node is node 2, and so forth.) If the value is not found, the function should return 0.
- Dont forget to add a destructor that destroys the list. Demonstrate the class with a driver program.
Output
Here are the initial values:
Here are the values:
2
3
4
6
8
9
9
13
Searching for the value 6.
Found in node number: 4
Searching for the value 10.
Found node number: 0
Here are the values:
2
3
4
8
9
10
13
Searching for the value 6.
Found in node number: 0
Searching for the value 10.
Found in node number: 6
It is using C++.
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