Cascade-Cut (H, y)
The above Procedure consider various cases of y being marked and unmarked. The Procedure calls itself repeatedly until either a root or an unmarked node is found.
Step 1 Initialization
set z Parent [y]
Step 2 Checking y to be marked or unmarked
if (z Nil) then
if (mark [y] = FALSE) then
mark [y] TRUE
else
call to Cut (H, y, z)
call to Cascade-Cut (H, z).
Step 3 Return at the point of call
return
No comments:
Post a Comment