You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a linked list and positions m and n. Reverse the linked list from position m to n.
Example 1:
Input:
N = 6
Linked List = 1->2->3->4->5->6->NULL
m = 2, n = 4
Output: 1 4 3 2 5 6
Explanation:
Nodes from position 2 to 4
are reversed resulting in
1 4 3 2 5 6.
The text was updated successfully, but these errors were encountered:
Given a linked list and positions m and n. Reverse the linked list from position m to n.
Example 1:
Input:
N = 6
Linked List = 1->2->3->4->5->6->NULL
m = 2, n = 4
Output: 1 4 3 2 5 6
Explanation:
Nodes from position 2 to 4
are reversed resulting in
1 4 3 2 5 6.
The text was updated successfully, but these errors were encountered: