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

Which one is greater 8.3 or 8.03
how to right 0.632 in expanded form
Elevation refers to the ?
Which of the following best describes the difference between the way that early historians and modern historians have studied the past? a. Early historians con
Find the missing number in the patter explain your reasoning 12,24,72,288
Whats an Inciting Incident
If you're currently earning $9.25 per hour and you received a 4% increase, what would be your new hourly rate
do you think northerners were right to stop supporting reconstruction
Where did Labor Day originate? A. Canada B. Ohio C. JCPenney D. California
Using the scientific method, a(n) _____ must be tested as the focus of any experiment.