This is a course web page of David Casperson |
|
Questions 1–13 are now due. (Find questions that are due here.)
subList 3 [2,3,5,7,11]
should be
[[2,3,5], [2,3,7], [2,3,11], [2,5,7],
[2,5,11], [2,7,11], [3,5,7], [3,5,11],
[3,7,11], [5,7,11]]
If possible, make your program incremental, so that a
computation like
3 `take` (100000 `drop` (subList 20 [1..40]))
is relatively fast.
If possible, make your program tail recursive.
[3,5,11] `isSubList` [2,3,5,7,11]
should
be True
; [3,5,2] `isSubList` [2,3,5,7,11]
should
be False
.
[1 .. 40]
of
the form [2,X,4,Y,Z, ...]
where X+Y+Z=16.
memberRem(X,Set,Setp)
that holds when
X
is a member of the list Set
, and SetP
is what
results when X
is deleted from Set
.
For instance,
memberRem(3,[1,2,3,4],U)
succeeds with U=[1,2,4]
.
fall-2024