Algorithm · Oracle · Easy
Given the first node of a singly linked list, delete every node whose 1-indexed position is even. In other words, nodes at positions 2, 4, 6, ... should be removed, while the remaining nodes keep their original relative order. The input is provided in the following form: Here n is the number of nodes, and v1 ... vn are the node values. Print the values of the remaining nodes on a single line, separated by single spaces. If all nodes are deleted, print an empty line. Example…
Checking your access…