Define rules to implement the reverse operation(reverse (list 1 4 9 16 25))(25 16 9 4…
Define rules to implement the reverse operation
(reverse (list 1 4 9 16 25))
(25 16 9 4 1)
B299:B317which returns alist containing the same elements as a given list in reverse order. (Hint: Use append-to-form.)Can your rules answer both (reverse (1 2 3) ?x) and (reverse ?x (1 2 3)) ?