Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions

Question

What is joint attention? Why is joint attention important?

Answered: 1 week ago