Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN ML Exercise 8 Write a function sorts of type real . real * real - real list that returns a list of three real

IN ML

image text in transcribed

Exercise 8 Write a function sorts of type real . real * real - real list that returns a list of three real numbers, in sorted order with the small est first. Exercise 9 Write a function de 13 of type 'a list -> 'a list whose output list is the same as the input list, but with the third element deleted. Your function need not behave well on lists with lengths less than 3. Exercise 10 Write a function sqsum of type int -> int that takes a non-neg- ative integer n and returns the sum of the squares of all the integers 0 through n. Your function need not behave well on inputs less than zero. Exercise 11 Write a function cycle of type 'a list * int> 'a list that takes a list and an integer n as input and returns the same list, but with the first ele- ment cycled to the end of the list n times. (Make use of your cyclei function from a previous exercise.) For example, cycle (11,2,3,4,5,6),2) should return the list (3,4,5,6,1,2]

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

Step: 3

blur-text-image

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

Practical Database Programming With Visual Basic.NET

Authors: Ying Bai

1st Edition

0521712351, 978-0521712354

More Books

Students also viewed these Databases questions

Question

Use a customer presentation card.

Answered: 1 week ago

Question

4 How the market system adjusts to change and promotes progress.

Answered: 1 week ago