Assume a tree is a subtree of the other if all elements of the first
tree is included in the second with the exact structure; all
parent-child relations are preserved with their order.

data
Tree = Empty | Leaf Int | Node (Int,Tree,Tree)
subtree::
Tree -> Tree -> Bool

How can i start to write this code with this data structure? 
Example;


tree1 tree2 
  3
 / \
5   6
   / \
  7   4
        13
     /    \
3      12
   / \     / \ 
5   6   9   6
     / \     / \
7   4   11  7
   /   / \
  2   3   4


      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to