Algorithm · NVIDIA · Hard
Given a singly linked list, reverse its node order in place, so that the original tail becomes the new head. The input is given as an array values containing the node values in their original order, plus a cycle descriptor cyclePos. If cyclePos is not None, the tail node points back to the node at that zero-based index. Before reversing, break this back-edge so the list becomes acyclic. Return the node values in their order after the reversal. Your solution must include: An…
Checking your access…