Question: sml and include the for example part 1. (6p) Function member of type a a list bool so that member(e, L ) returns true

sml and include the for example part 1. (6p) Function member ofsml and include the for example part

1. (6p) Function member of type " a" a list bool so that member(e, L ) returns true if and only if e is an element of the list L. For example member(3, [1,7,4,5,3,9,2]) should return true and member(6,[1,7,4,5,3,9,2]) should return false. 2. (8p) Function union of type 'a list * 'a list 'a list that returns the union of two lists (in any order). For example union ([3,4,7,9,8,5],[5,7,6,2,1,8,9]) should return [3,4,7,9,8,5,6,2,1] (in any order). 3. (10p) Function mergesort of type int list int list that sorts the given list of integers using the merge-sort algorithm. For example mergesort [3,4,7,9,8,5,6,2,1] should return [1,2,3,4,5,6,7,8,9]. 4. (10p) Function quicksort of type int list int list that sorts the given list of integers using the quick-sort algorithm. For example quicksort [3,4,7,9,8,5,6,2,1] should return [1,2,3,4,5,6,7,8,9]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!