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

Plot A(2,3) and B(2,5). What is the midpoint of points A and B?
For each function f, find f^-1 and f^-1(5). f={(-1,5), (0,0), (2,6)}
96 members are going to pass a resolution to select a team leader. If 1/6 of the members voted in favor and 2/5 of the members voted against how many did not vo
The value of 3 in 6,300 is _____ times the value of 3 in 530.
1. The report tomorrow (finish).​
Plot A(2,3) and B(2,5). What is the midpoint of points A and B?
The value of 3 in 6,300 is _____ times the value of 3 in 530.
Solve the inequality
With a $230,000 annual profit achieved from a $2,000,000 investment, the return on investment (ROI%) for a business would be
at the market opening, a customer purchases 200 shares of an S&P 500 inverse etf (-1x) at $50 per share. At the end of that day, the s&P 500 index decli