From 8114dc9ef81a25744c450f769674f16f95f04efa Mon Sep 17 00:00:00 2001 From: Mohammadjafari80 Date: Thu, 4 Feb 2021 15:45:41 +0330 Subject: [PATCH] fix Delete method bug --- data-structures/binary-tree/bst.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-structures/binary-tree/bst.go b/data-structures/binary-tree/bst.go index da1aa35..b14ee46 100644 --- a/data-structures/binary-tree/bst.go +++ b/data-structures/binary-tree/bst.go @@ -133,7 +133,7 @@ func (t *Tree) Delete(i int) bool { return true } - if parent.Left == n { + if parent.Left == h { parent.Left = nil } else { parent.Right = nil