Question: Question 6 [101 61 Write a tail-recursive Prolog procedure product/L, N) that calculates the product of all the terms list L and returns the result
Question 6 [101 61 Write a tail-recursive Prolog procedure product/L, N) that calculates the product of all the terms list L and returns the result in N (4) 6 2 Write a non-tail-recursive Prolog program that solves the same problem as in part (a)above (4) 63 Which program is more efficient in terms of space usage? Why is this the case? (2)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
