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

Given the balanced equation representing a reaction: O2 --> O + O What occurs during this reaction? (1) Energy is absorbed as bonds are brok
Find the GCF of each set of trinomials 60x^2y^2 , 35xz^3
Where is the Statue of Liberty?
Name one war fought by the United States in the 1900s.
How to write third person and describe please give me Ideas thank you
The House of Representatives has how many voting members?
What is the approximate height of the average adult in centimeters?
What is the name of the President of the United States now?
If the President can no longer serve, who becomes President?
Which energy conversion must occur in an operating electrolytic cell? (1) electrical energy to chemical energy (2) electrical energy to nuclear energy (3) chemi