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
Previously, q_delete_mid simply returned true without performing
any deletion. This change implements the actual logic to find
and remove the middle node from a doubly circular linked list.
Instead of using the traditional slow-fast pointer approach,
this implementation adopts a two-pointer convergence strategy,
where pointers move inward from both ends simultaneously.
This reduces the number of steps compared to the slow-fast
pointer method, improving efficiency.
Specifically, for a list of size n, this approach decreases
the number of traversals by approximately n/2 steps.
Change-Id: Ie9d2eadd23600f2999267151ed5c9468ffebf208
0 commit comments