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 angle is complementary to ∠EAD?
what types of angles are in these quadrilaterals iready level d
Please help!!!!!!!!!
When a volcano erodes and the solidified conduit is exposed, it is referred to as a volcanic ______.
Select the correct answer from each drop-down menu. the united nations promotes in an effort to maintain world peace and protect future generations. the toxic i
How the events of WWI influenced the totalitarian movement and lead to the events of WWII I need 5 facts
All powder laundry detergent is packaged in small 2 oz. packets so it will be more affordable for low-income consumers. All detergent convenience packets are sm
Find c. Give your answer in the simplest form. c = [?]V [] d 7V2 a 45 30 b C Enter the number that belongs in the green box.
Volume of pyramids cones and spheres
Calculating the volume of an irregular solid