Write a program for implementing queue using linked lists, for which you should use a structure to create a node with data and the next pointer. The program should be able to insert, delete and display nodes in the queue. The user will be asked to enter his choice either to insert a node (enqueue), delete a node (dequeue), display or to exit from the program. The options for the user should be as the following:
Write a program for implementing queue using linked lists, for which you should use a structure to
create a node with data and the next pointer. The program should be able to insert, delete and display
nodes in the queue. The user will be asked to enter his choice either to insert a node (enqueue), delete a
node (dequeue), display or to exit from the program.
The options for the user should be as the following:
1. Insert a node (Enqueue)
2. Delete a node (Dequeue)
3. Display
4. Exit
For example if user selected option 1 then the following should appear in the output:
Enter the value to insert:
Node is inserted
If user selected option 2 then the following should appear in the output:
Deleted Element is:
If the user selected option 3 then the program should display the elements that are available in
the queue
The program will keep on running and taking inputs from the user until he selects the 4th option to exit.
Step by step
Solved in 4 steps with 3 images