Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ / Linked List Manipulations Develop a program that will maintain an ordered linked list of positive whole numbers. Your program will provide for the

C++ / Linked List Manipulations

Develop a program that will maintain an ordered linked list of positive whole numbers. Your program will provide for the following options:

a. Add a number

b. Delete a number

c. Search for a number

d. Display the whole list of numbers

At all times, the program will keep the list ordered (the smallest number first and the largest number last).

At the start of the program, the list will be empty. The user will add new numbers by choosing the "add" option and will supply the number to be included in the list. The program will add the number to the list at the appropriate position in the linked list so that the list will remain ordered.

If the number being added is already in the list, the program will display a message: "Duplicate number. Not added to the list". This will ensure that the list does not contain any duplicate numbers.

For removing a number from the list, the user will choose the "delete" option and supply the number to be removed. If the number is in the list, it will be eliminated from the linked list. Otherwise, a message will be displayed: "Number is not in the list". For looking up a number in the list, the user will choose the "search" option and will provide the number to be found. If the number is in the list, the program will display : "the number is in the list". Otherwise, it will display: the number is not in the list".

For printing, the complete list of numbers, the user will select the "display" option. This option will display the list of all the numbers in the list. It should be an ordered list of unique numbers.

Instructions: Use the following structure for storing each number. struct entry { int number; entry * next; }

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 Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

LO23.3 Demonstrate how income inequality has changed since 1975.

Answered: 1 week ago

Question

LO23.2 Discuss the extent and sources of income inequality.

Answered: 1 week ago