Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (*Basically a Tree has a boolean, and a list of (char, tree(childs)). Image for easier understanding http://i.imgur.com/rHKQDyl.png
- The tree contains words. let's say we have 'h'(false)->'e'(false)->'l'(false)->'l'(true)->'o'(true)
- False means it's not a word, True means it's a word (in that example we have Hell and Hello).*)
- type tree = Node of bool ref * (char * tree) list ref (* This cannot be changed *)
- let empty () = Node(ref false,ref[])
- (* Function make_branch: char list -> tree
- Where the char list is a word
- *)
- let rec make_branch lc =
- (*I must implement code here *)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement