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

a vehicle starts from rsst and after 10 seconds its velocity is 20m/s find the acceleration and the distance travelled.(step by step only please)​
viết đoạn văn cảm nghĩ của em về nhân vật ông Hai trong truyện ngắn Làng
essay on my country my pride​
why is the nervous system better suited to control a person's movement than the endocrine system
PLZ HELP ITS DUE TODAY!!!!!!
Maths WC Year 9 Winter homik Overview o B AN Question Progress Homework Progress FRUIK Solve x - 7x - 34 = 10​
How I can answer this question, NO LINKS, if you answer correctly I will give u brainliest!
I don't know the answer, and I would like some help as fast as possible, please
Which integer is the smallest? A. 34 B.-4 C.-84 D. 24
For what values of m, the relation K= {(-1.5m +4, -23), (6m - 7,23)} is not a function