Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started