C program to create a doubly linked list. Make sure one of the entered elements is 24. Insert a new element after the existing linked list element 24. If there are more than one occurrence of 24, give user the choice where the new element must be inserted. Below is the sample, program should be created for various input. __Sample1_________________________________________ Input 24 19 32 45 24 39 -999 -56 Output 2 occurrence of 24 found. Where should the insertion occur? Input 1 Output 24 -56 19 32 45 24 39 _Sample 2__________________________________________ Input 42 19 32 45 46 39 -999 -27 Output No occurrence of 24 found. ____Sample 3________________________________ Input 24 19 32 45 24 39 46 24 54 -999 35 Output 3 occurrence of 24 found. Where should the insertion occur? Input 3 Output 24 19 32 45 24 39 46 24 35 54 _____________________________________________ ____Sample 4________________________________ --- Input --- 24 24 24 24 24 -999 0 Output 5 occurrence of 24 found. Where should the insertion occur? Input 5 Output 24 24 24 24 24 0
C
Insert a new element after the existing linked list element 24.
If there are more than one occurrence of 24, give user the choice where the new element must be inserted.
Below is the sample, program should be created for various input.
__Sample1_________________________________________
Input
24 19 32 45 24 39 -999
-56
Output
2 occurrence of 24 found. Where should the insertion occur?
Input
1
Output
24 -56 19 32 45 24 39
_Sample 2__________________________________________
Input
42 19 32 45 46 39 -999
-27
Output
No occurrence of 24 found.
____Sample 3________________________________
Input
24 19 32 45 24 39 46 24 54 -999
35
Output 3 occurrence of 24 found. Where should the insertion occur?
Input
3
Output
24 19 32 45 24 39 46 24 35 54
_____________________________________________
____Sample 4________________________________
--- Input ---
24 24 24 24 24 -999 0 Output 5 occurrence of 24 found. Where should the insertion occur? Input 5 Output 24 24 24 24 24 0
Step by step
Solved in 3 steps with 6 images