Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write in C++: Write a menu-driven program to illustrate the use of a linked list. The entries will only consist of integer number keys (values).

Write in C++:

Write a menu-driven program to illustrate the use of a linked list. The entries will only consist of integer number keys (values). The program should implement the following options in order:

Insert- insert a key into a list- not allowing duplicate integers.

Delete- delete a key from the list.

Search- finds or does not find a particular key in the list.

Print- prints the list graphically in horizontal form. If the list is empty output- "Nothing to print".

Size- count of all the keys in the list.

Sort- sorts the keys in the list in ascending order.

Reverse- reverses the order of the keys in the list

Rotate- moves the key at the front of the list to the end of the list. If the list has 0 or 1 elements it should have no effect on the list.

Shift- rearranges the keys of a list by moving to the end of the list all values that are in odd number positions (indexes) and otherwise preserving list order.

Clear - delete all the keys from the list. Output "Empty List".

Quit- Quit the program.

image text in transcribed

The print list option should consist of a data field which is an integer and pointer to the next node. It should look similar to below: Error check all menu inputs. A linked list data structure must be used. Output should be user friendly

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

More Books

Students also viewed these Databases questions