logo

Crowdly

The recursive function sum(n) is defined as follows: sum ( n ) = { 0 , if  n...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

The recursive function sum(n) is defined as follows:

sum(n)={0,if n=0n+sum(n1),if n>0

\text{sum}(n) =

\begin{cases}

0, & \text{if } n = 0 \\

n + \text{sum}(n-1), & \text{if } n > 0

\end{cases}

How many times is the function sum() called while evaluating sum(6)?

More questions like this

Want instant access to all verified answers on moovit.vit.ac.in?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!