1
0
forked from GitHub/gf-core

Added a collapse function to Trie

This commit is contained in:
markus
2003-11-11 11:59:21 +00:00
parent b568541112
commit 9b47b4aa12
3 changed files with 15 additions and 0 deletions

View File

@@ -10,6 +10,7 @@
module RedBlack (
emptyTree,
isEmpty,
Tree,
lookupTree,
insertTree,
@@ -32,6 +33,10 @@ balance color a x b = T color a x b
emptyTree :: Tree key el
emptyTree = E
isEmpty :: Tree key el -> Bool
isEmpty (E) = True
isEmpty _ = False
lookupTree :: Ord a => a -> Tree a b -> Maybe b
lookupTree _ E = Nothing
lookupTree x (T _ a (y,z) b)