Given a Singly Linked List of size N, your task is to complete the function deleteAlt(), which starting from the second node delete all alternate nodes of the list.
The function takes a single argument as input, the reference pointer to the head of the linked list. There will be T test cases and for each test case the function will be called separately.
For each test the output will be space separated values of the linked list.
1 2 3 4 5 6
99 59 42 20
1 3 5
Testcase 1: Deleting alternate nodes results in the linked list with elements 1->3->5.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.