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

2. What was the original purpose of the compass? A. To prolong life B. To cure illness C. To tell fortunes D. All of the above please answer now! due tmr!
Define proportional representation
hi will mark brainliest, 30 pts in your own words, describe what the pythagorean theorem is and why we use it.
how to simplify √12​
what is the area of a rectangle with vertices with (2,3), (7,3), (7,10), and (2,10)
Evaluate 9x + 3xy − 2 for x = 3 and y = −3.
The dot plot represents an order of varying shirt sizes. Which histogram represents the same data?
What is the inverse of the function f(x) = 2x – 10?
Need Help!!!!!!!!!!!!!!!!!!
All organisms contain _____ and require it to survive A. Helium B. Carbon C. Zinc D. Polonium