Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a doubly linked list. ( till the input is -999, we can enter the nodes ) Add 3 elements at the beginning of the
Create a doubly linked list. (till the input is -999, we can enter the nodes)
Add 3 elements at the beginning of the linked list. (If less than 3 elements are entered, the program should give Error message as output.)
Display the elements of the resulting doubly linked list in reverse order.
Sample Input/Output
Input
10 20 15 45 -999
-2 5 8
Output
45 15 20 10 -2 5 8
Input
84 19 32 45 25 39 -999
15
Output
Error!! Three elements must be inserted.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started