Question: 18. True or False: Function sum is tail recursive. fun sum xs - case xs of [ ] => 0 | i::xs' => i +

18. True or False: Function sum is tail recursive. fun sum xs - case xs of [ ] => 0 | i::xs' => i + sum xs (1 point) True False 19. fold is tail recursive fun fold f acc lst = case 1st of [ ] => acc | hd::t1 => fold f (F(acc, hd)) ti (1 point) True False 20. What is ans bound to after the following ML code is evaluated? exception E val x = 1 fun f x = if x=2 then raise E else 14 val x = 2 ((f x) + 4) handle E => 9 val ans (1 point)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
