What does the following set of the recursive rules do? bar([ ],[ ]). bar([X | L],F) :- bar(L, G), append(G, [X], F).

What does the following set of the recursive rules do?

bar([ ],[ ]).

bar([X | L],F) :- bar(L, G), append(G, [X], F).

Answers:      

A. Append two lists.  
B. Compute the length of a list.  
C. Find the last element of a list.  
D. Compute the sum of a list.
E. Reverse a list.

Answer. E.


Computer Science

Learn More Multiple Choice Question :