Guest User

Untitled

a guest
Jan 19th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. (15 points)
  2. Define an data type OrderedTree that represents ordered trees using the same representation as in Assignment 2, but where the type of the data in the nodes is always String.
  3. Make this type an instance of the Show and the Eq typeclasses. In the latter case you are to use the default behavior of the typeclass, but in the former case you are to have a show function that returns a string with the same format as the Java toString method of Assignment 2. You may use the string "\n" as a line terminator.
  4. For partial credit you may simply define show function for OrderedTrees, without using the Show class.
  5.  
  6. Define a binary boolean-valued member function that takes a String and an OrderedTree, and determines whether the string appears anywhere in the tree.
Add Comment
Please, Sign In to add comment