programmer720
Programmer
I'm looking for these 2 algorithms...
REVERSE: given a list L, find the reverse R of L (top-level elements only). For example,
?-reverse([ ], R). should answer R = [ ]
?-reverse([1, 2, [3, 4]], R). should answer R = [[3, 4], 2, 1].
INTERSECT: given sets X and Y (represented as lists), intersect(X, Y, I) finds I which is X¿Y.
Thanks a lot.
REVERSE: given a list L, find the reverse R of L (top-level elements only). For example,
?-reverse([ ], R). should answer R = [ ]
?-reverse([1, 2, [3, 4]], R). should answer R = [[3, 4], 2, 1].
INTERSECT: given sets X and Y (represented as lists), intersect(X, Y, I) finds I which is X¿Y.
Thanks a lot.