Answered step by step
Verified Expert Solution
Link Copied!

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

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_2

Step: 3

blur-text-image_3

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

Data Visualization A Practical Introduction

Authors: Kieran Healy

1st Edition

0691181624, 978-0691181622

More Books

Students also viewed these Databases questions

Question

How can the Internet be helpful in a job search? (Objective 2)

Answered: 1 week ago