a. Write a recursive LISP function that will reverse the elements of a list. (Do not use
Question:
a. Write a recursive LISP function that will reverse the elements of a list. (Do not use the built-in reverse function.) What is the complexity of your implementation? It is possible to reverse a list in linear time; can you do so?
b. Write a LISP function that will take a list nested to any depth and print the mirror image of that list. For instance, the function should have the behavior:
> (mirror ’((a
b) (c (d e))))
(((e
d) c) (b a))
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Artificial Intelligence Structures And Strategies For Complex Problem Solving
ISBN: 9780321263186
5th Edition
Authors: George F. Luger
Question Posted: