Define a procedure that takes a list as a single argument, Programming Languages

(a) Define a procedure (subsets x) that takes a list as a single argument and returns all 2^n subsets of that list, i.e. the power set of the list;

e.g. (subsets '(a b c)) ==> (() (c) (b) (b c) (a) (a c) (a b) (a b c))             

The order of the subsets returned is not important.

(b) Define an iterative function (filter pred lst) that applies a predicate pred to each element of a list lst and returns a list of elements that satisfy the predicate; e.g. (filter even? '(1 2 3 4 5 6)) ==> (2 4 6).

(c) Define a procedure (interleave x y) that takes 2 list arguments and returns the 2 lists interleaved; e.g. (interleave '(a b c) '(d e f)) => (a d b e c f).

You must deal with the case when the two lists are not of equal

Posted Date: 3/30/2013 6:24:43 AM | Location : United States







Related Discussions:- Define a procedure that takes a list as a single argument, Assignment Help, Ask Question on Define a procedure that takes a list as a single argument, Get Answer, Expert's Help, Define a procedure that takes a list as a single argument Discussions

Write discussion on Define a procedure that takes a list as a single argument
Your posts are moderated
Related Questions
Task: This assignment is about writing programmes and Web Services in C#: 1) Develop a console programme that reads a sequence of integer numbers from the console and sorts

list of 10 operating systems with their hardware specification and also list any 5 software associated with each operating system

In the form of hypermedia documents, Web pages or materials accessed by the Internet can be located anywhere in the world. Regardless of where they originated, most of the Web d

Question: (a) In JavaScript, the Window Object is commonly used to request information from a user or to output some results. Give three ways how to create instances of the

Problem: (i) All Security authentication mechanism that run on the TRU64 Unix Operating system run under the Security Integration Architecture ( SIA ) layer. Explain with diag

An HTML document may be created via any HTML editor or text editor such as notepad etc.

Expertsmind brings you unique solution in java assignments Event Delegation Model The Delegation Model with java assignment help Version 1.1 of the Java TM foundation

Expertsmind.com is expert in java assignment help JAVA Virtual Machine A Java exclusive device or java virtual machine (JVM) is an exclusive device able of undertaking Jav

Design the proposed implementation using the contract first approach and object oriented approaches.  At a minimum, you must provide an overview of the services in the service arch

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4