CSC 4101 Chapter : Homework5

9 views2 pages
15 Mar 2019
School
Course
Professor

Document Summary

Write set membership test and set union programs in each of the languages scheme and ml. Each function will only be about two or three lines long. As data structure for sets, we will use unordered lists. E. g. , the scheme list "(11 15 3) represents the set {3. Each element should appear only once in the set. Write scheme functions memv? and union of the following types. The boolean function memv? takes an element and a list and returns true if and only if the element is in the list. Use the comparison eqv? for comparing individual elements. The function union takes two lists and returns a list representing the set union of the arguments. I. e. , the result list contains all the elements that are in either argument list. Similarly, write two ml functions member and union. For comparing individual elements, you can use =.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions