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

What form of reproduction do organisms that produce gametes use?
Please Help (: Mitosis and meiosis are similar processes, but they have some very important differences. Explain how mitosis and meiosis are alike and how they
Which of the following types of mixtures exhibit the Tyndall effect? a. solutions c. colloids b. suspensions d. none of the above
what is 47 rounded to the nearest 100
I really need help with this question Compared to atoms of the same element, isotopes have different A. numbers of protons. B. types of subatomic particles. C
Find the value of 24/m when m= -8
Value of the expression. ? 18-2x(4+3)
When glaciers melt, they leave ridges of rock, gravel, sand, and clay called _______. a. moraines b. cirques c. drumlins d. eskers
during what stage of the cell cycle does replication occur
Please help me what is this