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

(10y^3+20y^2+55y)/5y
Marika and Freddy sold 70 homes for Ron Realty. If Marika sold 2.5 times as many homes as Freddy, how many homes did each sell?
Data are drawn from a symmetric and bell shaped distribution with a mean of 120 and a standard deviation of 5. There are 900 observations in the data set. What
what is the answer for (20,8),(9,16) ?
Historians of china have traditionally dated the beginning of Chinese civilization to the founding of the what??
Scarcity is the condition of not having enough goods and services to satisfy everyone's?
what is the answer for (20,8),(9,16) ?
Can someone use the word delta in a sentence
(10y^3+20y^2+55y)/5y
Data are drawn from a symmetric and bell shaped distribution with a mean of 120 and a standard deviation of 5. There are 900 observations in the data set. What