Question: Write a recursive Prolog procedure triangle(M,N) that determines the number of balls N in a triangle with M balls in the bottom level. Each level
Write a recursive Prolog procedure triangle(M,N) that determines the number of balls N in a triangle with M balls in the bottom level. Each level has one ball fewer than the previous level. The top level (base case) contains only 1 ball.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
