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

is 9.777..... a whole number, integer,rational number, irrational number, real number.
Which was a reason for the First Crusade? a. Muslim caliphs wanted to overthrow the Jewish kingdom that had been established in Palestine. b. European merchan
Is 9.7.... A whole number,integer,rational number,irrational number,or a real number
An active student injured his knee playing basketball and has been advised by his doctor to avoid impact activities that cause heavy force on his bones. What is
A building casts a 50-foot shadow. Alex is 5 feet tall and casts a 6-foot shadow. Approximately how tall is the building? a. 60 ft b. 24 ft c. 50 ft d. 42 f
49 increased by twice a number n
what is 14,494 to the nearest ten thousand feet
Who discovered animal-like-protists?
Round 6,529 to the nearest thousands
What is the square root of 120? And is ur rational or irrational?