JoeM3388 JoeM3388
  • 03-04-2015
  • Computers and Technology
contestada

Give a recursive algorithm for finding the sum of the
first n odd positive integers.

Respuesta :

Hippalectryon
Hippalectryon Hippalectryon
  • 03-04-2015
I'm writing that in some sort of pseudocode; if you don't understand it, feel free to ask for more details in the comments.

function sumOdd(n)
    if n==1 then
        return 1
    end if
    return (sumOdd(n-1))+(n*2-1)
end function
Answer Link

Otras preguntas

Why is Xenon important?
A general rule for adding text to a slide is ____.
A higher marginal income tax rate reduces incentives to work because
According to the rational root theorem, the following are potential roots of f(x) = 60x^2 - 57x - 18. Which is an actual root A) -6/5 B) -1/4 C) 3 D) 6
Which war production bored programs provided assistance during the war
HELPPPPPPPPP+ EXPAINNNNNNNN
-6x-7=3x+11 how to solve this problem
Question 9 Why do we study Greek literature and theater? A)Because it is interesting. B)To understand Greek philosophy C)To understand Greek culture Question
Your family goes to a southern style restaurant for dinner. There are 6 people in your family. Some order the chicken dinner for $14 and some order the steak di
What is the most common cause of iron deficiency anemia?