summaryrefslogtreecommitdiff
path: root/H63.hs
diff options
context:
space:
mode:
Diffstat (limited to 'H63.hs')
-rw-r--r--H63.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/H63.hs b/H63.hs
new file mode 100644
index 0000000..03f081e
--- /dev/null
+++ b/H63.hs
@@ -0,0 +1,8 @@
+import Tree
+
+completeBinaryTree n = makeTree 1
+ where makeTree x
+ | x > n = Empty
+ | otherwise = Branch 'x' (makeTree (2*x)) (makeTree (2*x+1))
+
+isCompleteBinaryTree