' ************************************************ ' Replace the target node with the rightmost node ' to the left of it. ' ************************************************ Private Sub ReplaceRightmost(repl As AVLNode, shrunk As Boolean, target As AVLNode) Dim child As AVLNode If repl.RightChild Is Nothing Then target.Box.Caption = repl.Box.Caption ' 5/27/98 The following line was commented out ' by Rod Stephens to fix a bug. ' Set target = repl Set repl = repl.LeftChild shrunk = True Else Set child = repl.RightChild ReplaceRightmost child, shrunk, target Set repl.RightChild = child If shrunk Then RebalanceRightShrunk repl, shrunk End If End Sub