can u plz help me out with this code i am unable to understand the error
EVENafterODD_linkedlist
Hello @Tiya,
-
Syntax of function Call statements for insertAtTail() and insertAtHead() are wrong.
-
You are not taking input for elements of array i.e. data.
-
You are adding the odd elements in wrong manner.
The one that comes later should be placed after the one comes before in the linked list.
Example:
input:
6
1 2 3 4 5 6
Your output:
5 3 1 2 4 6
Expected Output:
1 3 5 2 4 6
I have modified your code:
Hope, this would help.
Give a like, if you are satisfied.