In the following three questions, use the following definition of the tree datatype.
datatype tree = Leaf of int | Node of tree * tree
fun f (Leaf n) = [n] | f (Node(left,right)) = (f right) @ (f left);
fun pick (Leaf N) = N | pick (Node(left,right)) = let val (x,y) = (pick left, pick right) in if x < y then x else y end;What function does pick compute? Pick only one answer.
fun sumup (Leaf n) = n | sumup (Node(left, right)) = (sumup left) + (sumup right);This function will sum up all the integers labeling leaves in the input tree.
(int * int -> int) * tree -> intand where the first argument to opup is to be used instead of the plus (+).
fun opup (Op, (Leaf n)) = n | opup (Op, (Node(left, right))) = Op(opup(Op, left), opup (Op, right));