O(N) Time complexity Two pointer approach
Intuition\n Describe your first thoughts on how to solve this problem. \nStore all elements of the linked list and then by two pointers make the required linked
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nStore all elements of the linked list and then by two pointers make the required linked list.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nMake a list to store all the nodes taking O(n) space complexity. Make two pointers from 1th index and length(list)-1 index. Add the last pointer to the head and then add the element of first index to it. Repeat it till low>high. Then clear the address of the last node and the question is done.\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(n)$$\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$O(n)$$\n# Code\n```\n# Definition for singly-linked list.\n# class ListNode:\n#     def __init__(self, val=0, next=None):\n#         self.val = val\n#         self.next = next\nclass Solution:\n    def reorderList(self, head: Optional[ListNode]) -> None:\n        """\n        Do not return anything, modify head in-place instead.\n        """\n        lst=[]\n        start=head\n        while(start!=None):\n            lst.append(start)\n            start=start.next\n        length=len(lst)\n        low=1\n        high=length-1\n        start=head\n        while(low<=high):\n            \n            start.next=lst[high]\n            high-=1\n            start=start.next\n            start.next=lst[low]\n            start=start.next\n            low+=1\n        start.next=None\n\n\n```
['Python3']