Answered step by step
Verified Expert Solution
Question
1 Approved Answer
OCaml Programming: (Do not use List module or other library functions) diff: 'a list -> 'a list -> 'a list diff a b returns the
OCaml Programming: (Do not use List module or other library functions) diff: 'a list -> 'a list -> 'a list
diff a b returns the difference of sets a and b in a. For example, eq (diff [1;3;2] [2;3]) [1] = true.
In [ ]:
let rec diff a b = (* YOUR CODE HERE *)
In [ ]:
assert (eq (diff [1;3;2] [2;3]) [1]); assert (eq (diff ['a';'b';'c';'d'] ['a';'e';'i';'o';'u']) ['b';'c';'d']); assert (eq (diff ["hello";"ocaml"] ["hi";"python"]) ["hello";"ocaml"]);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started