Closed psorat307 closed 2 years ago
Hello @psorat307, thanks for creating your first issue at LearnCPP, hope you followed the guidelines.
/assign
This issue has been assigned to psorat307! It will become unassigned if it is not closed within 12 days. A maintainer can also add the pinned label to prevent it from being unassigned.
This issue is stale because it has been open 3 days with no activity. Remove stale label or comment or this will be closed in 2 days.
This issue was closed because it has been stalled for 5 days with no activity. Please reopen this issue if not resolved.
Description
Given a linked list, write a function to reverse every k nodes (where k is an input to the function).
k is a positive integer and is less than or equal to the length of the linked list. If the number of nodes is not a multiple of k then left-out nodes, in the end, should remain as it is.
Example 1:
Input: 1->2->3->4->5->NULL, K = 2 Output: 2->1->4->3->5->NULL Explaination: As the group size is 2, the first and second node got swapped and then the third and fourth node also got swapped.
Domain
CPP
Type of Contribution
Addition
Code of Conduct