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

Which of the following are benefits to modern breeding techniques? (select all that apply) A. More overall product B. able to select and breed traits quicker
first battle of texas fought here
How is a boycott effected
Which body part represents the notochord in vertebrates?
What is the GCF of 24 and 64
Which mariner was the first English man sail around the world
What is true of a synthesis reaction? The products are often pure elements. The reactants must be in an aqueous solution. There is only one product. Th
PLEASE HELP letty writes a blog on the history of american popular music, and she is working on a series of posts about the famous 19th-century songwriter steph
explain how you can add on to find the differennce 727-685
Part 2—Express Your Ideas Prompt In the video Un Día en la Vida: Ciudad de México, you learned about current-day Ciudad de México and Ciudad de México of the pa