mirror of
https://github.com/BinRoot/Haskell-Data-Analysis-Cookbook.git
synced 2024-11-29 01:24:19 +03:00
Modified code to accommodate 'Null' trees
This commit is contained in:
parent
f810b17aff
commit
3500c3cfb2
@ -21,3 +21,4 @@ valid (Node v l r) = leftValid && rightValid
|
||||
where leftValid = if notNull l then valid l && value l <= v else True
|
||||
rightValid = if notNull r then valid r && v <= value r else True
|
||||
notNull t = t/=Null
|
||||
valid Null = True
|
||||
|
Loading…
Reference in New Issue
Block a user