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

How to evaluate rational expressions
During replication,are responsible for joining the nucleotides of a new DNA strand together.​
Example of intellectual achievements of maths in modern world
Ben used 136.2 pounds of gravel in his front yard and 106.1 pounds in his back yard. How many more pounds of gravel does ben use in his front yard than his back
Find an equation of the line that passes through (2-2) (8,1)
Which answer best identifies the word(s) that the underlined phrase modifies? Against an enemy, however, it is used as a weapon of great power. weapon
NEED HELP PLEASE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Thinking about Epic Hero qualities, who do you view as one? Why? The person
PLS ANSWER ASAP!!!!The table below explains the average rate at which some geologic processes occur. Calculate theamount of sea level change, erosion and uplift
Find and compare the future value after two years of a attracting interest at a rate of 10% compounded a) annually and b) semi annually. deposit of $100
Use the x and y intercepts to sketch the graph of each line. Show work.