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; }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
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;
Transcribed Image Text: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;
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Threads in linked list
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education