This commit is contained in:
Aaro Koivukangas
2025-12-24 13:23:18 +02:00
parent cd9ff2fec2
commit aba0c1d0b1
+4 -1
View File
@@ -110,7 +110,10 @@ mapTree f Empty = Empty
-- (Node 3 Empty Empty))
cull :: Eq a => a -> Tree a -> Tree a
cull val tree = todo
cull val (Node value t1 t2)
| val == value = Empty
| otherwise = Node value (cull val t1) (cull val t2)
cull val Empty = Empty
------------------------------------------------------------------------------
-- Ex 7: check if a tree is ordered. A tree is ordered if: