Linked List Patterns

Reverse Nodes in k-Group

Given the head of a singly linked list and an integer k, reverse the nodes of the list k at a time and return the new head of the reversed…

Reverse Linked List II

Given the head of a singly linked list and two integers left and right, reverse the nodes of the list from position left to position right, and return the new…

Rotate List

Given the head of a singly linked list and an integer k, rotate the linked list to the right by k places. The rotation means moving the last k nodes…

Reverse Linked List

Given the head of a singly linked list, reverse the list in-place and return the new head of the reversed linked list.