Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Project Linked List: Implement problems 2, 3, and 4 from the end of the chapter Programming Exercises, page 1174. Copy the classes from the textbook

image text in transcribed

Project Linked List: Implement problems 2, 3, and 4 from the end of the chapter Programming Exercises, page 1174. Copy the classes from the textbook resource page and implement the new 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).

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

1741 Chapter 16: Linked Lists 2 Extend theclase1inkedListType byadding 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 a given into from the list.Tra- verse 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. Extend the class1inkedLiatType byadding the following operations: a. Write a function that returns the info of the kth element of the 3. linked list. If no such element exists, terminate the program. h. Write a function that deletes the kth element of the linked list. If no such element exists, terminate the program. ProvidethedefinitionsofthesefunctionsintheclasslinkedListType Also, write a program to test these functions. (Use either the claaa unorderedLinkedList or the class orderedLinkedList to test your function.) 4 (Printing a single linked ist backward Include the functions reversePrint and recuraiveReversePrint, as discussed in this chapter, in the claaa linkedLdattype. Also, write a program function to print a (single) linked list backward. (Use either the class unorderedLinkedList or the claa orderadtinkediat to test your function.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books