summaryrefslogtreecommitdiff
path: root/H56.hs
diff options
context:
space:
mode:
authorJoe Zhao <ztuowen@gmail.com>2015-04-05 15:33:17 +0800
committerJoe Zhao <ztuowen@gmail.com>2015-04-05 15:33:17 +0800
commitef5f19da8865b53f6edf68041a8e270a28031955 (patch)
tree4c3b214c61665f9b73354416a66225106525efa8 /H56.hs
parent13c0046a6dbd41b15358e76856922144ac76e768 (diff)
downloadh99-ef5f19da8865b53f6edf68041a8e270a28031955.tar.gz
h99-ef5f19da8865b53f6edf68041a8e270a28031955.tar.bz2
h99-ef5f19da8865b53f6edf68041a8e270a28031955.zip
+H55 +H56 +Tree
Diffstat (limited to 'H56.hs')
-rw-r--r--H56.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/H56.hs b/H56.hs
new file mode 100644
index 0000000..3cf7127
--- /dev/null
+++ b/H56.hs
@@ -0,0 +1,8 @@
+import Tree
+
+mirror :: Tree a -> Tree a -> Bool
+mirror Empty Empty = True
+mirror a@(Branch _ a1 a2) b@(Branch _ b1 b2) = (mirror a1 b2) && (mirror a2 b1)
+mirror _ _ = False
+
+symmetric t = mirror t t