Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

all must be done in ML programming language : ( 1 5 points ) Define a function rem _ duplicate: ' ' a list -

all must be done in ML programming language : (15 points) Define a function rem_duplicate: ''a list ->''a list which takes in input a list and takes out all the duplicates. Test your code with sample input and report result. Examples: rem_duplicate []=[] rem_duplicate [1,2,1]=[1,2] rem_duplicate ["a","a","a"]=["a"] rem_duplicate [[1],[1,2],[1,2,3],[1,2],[4,5]]=[[1],[1,2],[1,2,3],[4,5]]2.(15 points) Define a function parts: string * string -> bool which takes as input, two strings, and returns true if and only if the second string is part of the first string. (Hint: Use the function explode learned in the class to break strings into lists of characters) Examples: parts(johnjay,ohnj)= true parts(johnjay,jay)= true parts(johnjay,johns)= false

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

Step: 3

blur-text-image

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

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions

Question

9. What would be the costs and benefits of taking these steps?

Answered: 1 week ago

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago