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
test(flowcontrol): add failing test for maxMinHeap.Remove heap corruption
Remove swaps position i with the last element then calls down() but
not up(). When the last element comes from a different subtree, the
ancestor relationship can break:
Before: After Remove(index=3, time=1):
0 0
/ \ / \
5 50 5 50
/ \ \ / \
1 4 40 40 4
Last element (index 5, time=40) swaps into index 3.
down(3): no children, no-op.
Node 1 (min-level, time=5) must be lowest-priority in {5, 40, 4}.
time=40 has lower priority than time=5 -- heap property violated.
Signed-off-by: RishabhSaini <rishabhsaini01@gmail.com>
0 commit comments