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
Add q_reverse to reverse the entire queue by swapping next and prev
pointers in a single pass, ensuring O(n) time complexity. This function
properly updates the head node to maintain a circular doubly
linked list.
Add q_reverseK to reverse every k nodes in the queue while keeping the
last group unchanged if its size is smaller than k.The implementation
uses list_move_tail() for efficient node reordering,
following the Linux Kernel linked list style.
Change-Id: I02a0975f23dadaabfc1cf1c2f830e7ce958325e1
0 commit comments