From 915e846b0113ab9f5e8b45fa0655ae36c94699cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Thu, 6 Jul 2023 22:23:47 +0200 Subject: [PATCH] Skeleton of generic BST removal with counting. --- src/util-bst.scm | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/util-bst.scm b/src/util-bst.scm index 8abb088..e85b99b 100644 --- a/src/util-bst.scm +++ b/src/util-bst.scm @@ -15,7 +15,7 @@ bst-contains? bst-set - ;;bst-remove ;; + bst-remove ;;bst->kvv ;;kvv->bst @@ -172,6 +172,36 @@ new-root (+ (bst-count bst) count-add))))) + (define/doc (bst-remove bst k . nos) + ("Removes given key from the BST.") + (let-comparators + (EQ?