mirror of
https://github.com/iritmaximus/haskell.git
synced 2026-10-12 19:13:39 +03:00
5b ex7
This commit is contained in:
+4
-1
@@ -155,7 +155,10 @@ cull val Empty = Empty
|
||||
-- (Node 3 Empty Empty)) ==> True
|
||||
|
||||
isOrdered :: Ord a => Tree a -> Bool
|
||||
isOrdered = todo
|
||||
isOrdered (Node val t1 t2)
|
||||
| allValues (val>) t1 && allValues (val<) t2 = isOrdered t1 && isOrdered t2
|
||||
| otherwise = False
|
||||
isOrdered Empty = True
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
-- Ex 8: a path in a tree can be represented as a list of steps that
|
||||
|
||||
Reference in New Issue
Block a user