Question: Please code in OCaml. Implementation needed. 4. In this question we want you to use find_max and remove to implement a selection sort algorithm. You

Please code in OCaml. Implementation needed.

Please code in OCaml. Implementation needed. 4. In this question we wantyou to use find_max and remove to implement a selection sort algorithm.

4. In this question we want you to use find_max and remove to implement a selection sort algorithm. You can assume that the list contains no duplicates. # let rec selsort l = .. val selsort : 'a list -> 'a list = # selsort [1; 4; 2; 5; 3; 9; 6; 8; 7];; - : int list = [9; 8; 7; 6; 5; 4; 3; 2; 1] You are not allowed to use built-in sorting functions. Even though your code is polymorphic and should work on all types for which an order is defined (int, char, string) the grader will get confused if you try to give it a list containing items of different types. Please only test this on integer lists. (* Q4 TODO: Write your own tests for the selsort function. *) let selsort_tests = [ (* Your test cases go here. *) (* 04 TODO: Implement selsort. *) let rec selsort 1 = raise NotImplemented 4. In this question we want you to use find_max and remove to implement a selection sort algorithm. You can assume that the list contains no duplicates. # let rec selsort l = .. val selsort : 'a list -> 'a list = # selsort [1; 4; 2; 5; 3; 9; 6; 8; 7];; - : int list = [9; 8; 7; 6; 5; 4; 3; 2; 1] You are not allowed to use built-in sorting functions. Even though your code is polymorphic and should work on all types for which an order is defined (int, char, string) the grader will get confused if you try to give it a list containing items of different types. Please only test this on integer lists. (* Q4 TODO: Write your own tests for the selsort function. *) let selsort_tests = [ (* Your test cases go here. *) (* 04 TODO: Implement selsort. *) let rec selsort 1 = raise NotImplemented

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!