hello every body ,
Actually , I found functions which use to remove node from binary tree
these are the functions :
(defun BST-remove (B E)
"Remove E from BST B."
(if (BST-empty-p B)
(if (bin-tree-leaf-p B)
(BST-leaf-remove B E)
(BST-node-remove B E))))
(defun BST-leaf-remove (L E)
"Remove E from BST leaf L."
(if (= E (bin-tree-leaf-element L))
(defun BST-node-remove (N E)
"Remove E from BST node N."
((elmt (bin-tree-node-element N))
(left (bin-tree-node-left N))
(right (bin-tree-node-right N)))
(if (<= E elmt)
(if (bin-tree-leaf-p left)
(if (= E (bin-tree-leaf-element left))
(make-bin-tree-node elmt (BST-node-remove left E) right))
(if (bin-tree-leaf-p right)
(if (= E (bin-tree-leaf-element right))
(make-bin-tree-node elmt left (BST-node-remove right E))))))
when I try to use them , they do not work as the explanation .
I implement all the function inside
could somebody tell me how I can edit them to work
thank you very much