EVENafterODD_linkedlist


can u plz help me out with this code i am unable to understand the error

Hello @Tiya,

  1. Syntax of function Call statements for insertAtTail() and insertAtHead() are wrong.

  2. You are not taking input for elements of array i.e. data.

  3. 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.