Question
2. Extend the class linkedListType by adding the following operations: a. Find and delete the node with the smallest info in the list. (Delete only
2. Extend the class linkedListType by adding the following operations:
a. Find and delete the node with the smallest info in the list. (Delete only the first occurrence and traverse the list only once)
b. Find and delete all occurrences of given info from the list. (Traverse the list only once.)
Add these as abstract functions in the class linkedListType and provide the definitions of these functions in the class unorderedLinkedList. Also, write a
program to test these functions.
For your test program, present the user with the following menu of options. Your program stays in a loop and performs the functions chosen, until the user enters 9 (to quit).
When the user starts your program, your list is empty.
1- Add a new item to the list
2- Delete the first occurrence of a given item from the list
3 Delete all occurrences of a given item from the list
4- Delete the smallest item from the list
5- Print the kth item in the list
6- Delete the kth item from the list
7- Print the list in reverse
8- print the list
9- Quit
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