Using sml to codeHere is a small exercise to get you working with trees. Make a le, P2.sml, and place in it this de nition ofIntTree: IntTree = Leaf | Node of int * IntTree * IntTreeNow, code this function, using any of the functions you have encountered so far on lists and trees:(* sumInts : IntTree -> intadds up all the ints contained in InTree t and returns the total.Examples: sumInts (Node(3, Node(2, Leaf, Node(4, Leaf, Leaf)), Leaf)) = 9sumInts (Leaf) = 0 *)Test your function on the two test cases listed above. Copy and paste your output
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here