This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: (a) Write a predicate reverse(X,Y) that is true if the list Y is the reverse of the list X . (b) Write a predicate sum(L,N) that is true if the number N is the sum of the numbers in the list L . http://www.cs.ucsd.edu/classes/fa06/cse130/shw/shw9.html (1 of 2) [2/13/2008 5:27:40 PM] Suggested Homework #9 (c) Write a predicate max(L,N) that is true if the number N is the largest (maximum) of the numbers in the list L . (d) Write a predicate sorted(L) that is true if the list L is sorted in increasing order. (e) Write a predicate subsequence(L1,L2) that is true if the list L2 is a subsequence of the list L1 . For example: subsequence([1,2,3,4],[2,4]) and subsequence([1,2,3],) but not subsequence([1,2,3],[3,1]) . http://www.cs.ucsd.edu/classes/fa06/cse130/shw/shw9.html (2 of 2) [2/13/2008 5:27:40 PM]...
View
Full
Document
This homework help was uploaded on 02/14/2008 for the course CSE 130 taught by Professor Jhala during the Fall '06 term at UCSD.
 Fall '06
 Jhala

Click to edit the document details