Question: sml only no java 1. (6p) Function member of type a a list bool so that member(e, L ) returns true if and only
sml only no java
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
Get step-by-step solutions from verified subject matter experts
