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

Evaluate the expression, using the given value of the variable. 4 – 2x + 5x when x = 4 A. –24 B. –18 C. 16 D. 28
need help on any number cause it is due tomorrow
What is the best way to change the sentence below from active voice to passive voice? Presenters give awards to the winners at the elaborate ceremony held every
how was the Jordan river different from the nile river
Why dose yellow river have that nick name?
How do you become an informed citizen?
The Chinese knew how to produce silk by about 2700 B.C. A. True B. False
What is 3.2 x 10^-4 m/h in centimeters per second? a) 8.889 × 10^−6 cm/s b) 8.889 × 10^−5 cm/s c) 1.152 × 10^−5 cm/s d) 1.152 × 10^−7 cm/s
here is the whole question cooking oils contains unsaturated fats. unsaturated fats are more healthy than saturated fats. unsaturated fats change bromine wate
the sales tax in Illinois is 6.25%. about how much will a pair of jeans that has a ticket price of $48.99 cost, including sales tax?