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 propert company sold 20% more houses in 2007 than it did in 2006. If the company sold 426 houses in 2007 calculate how many houses it sold in 2006
A stack of books is 70 inches high. How high is it in feet and inches?
how google was able to overcome its competitors ?
Demand is a powerful force in a free market. In three to four sentences, explain some of the factors that cause changes in demand and why it is important for co
what direction are the sailboats,barge,and tugs traveling
In a home for troubled youth, adolescents receive large colored buttons when they hang up their clothes, make their beds, and come to meals on time. the adolesc
Find the slope of the line. A. 1/3 B. -1/3 C. 3 D. -3
What is the superlative degree of powerfully
The sum of the measures of the interior angles of a triangle is equal to _____.
Determine whether the sides given would form an acute, obtuse, or right triangle. 7, 7, 13