릿코드
-
Linked List | Odd Even Linked ListAlgorithm/Linked List 2021. 5. 24. 22:44
Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list. The first node is considered odd, and the second node is even, and so on. Note that the relative order inside both the even and odd groups should remain as it was in the input. Linked List가 주어졌을 때, 홀수번째 노드들과 짝수번째 노드들을 나누어서, 모든 홀수는 앞쪽에, 모든 짝..