forked from sysprog21/lab0-c
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify deletion function and add reverse function
During the execution of q_delete_dup, the code identified a problem with blocks still being allocated. To address this, I made modifications to ensure that the memory allocated for the original 'prob' is freed before updating its memory location. This resolves the issue of memory blocks not being properly deallocated. Implement q_reverseK function to reverse the nodes of the list k at a time. The function calculates the length of the queue and then performs a partial reverse by swapping the prev and next pointers of each element. Additionally, adjustments are made to the head and tail nodes to ensure proper reversal of the segments.
- Loading branch information
Showing
1 changed file
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters