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

What is 4*10^5/4*10^-6=?
4/5+3/1/10 = ? plz help me with this
Look at the time on the following clocks. How much time has passed from the first clock to the second clock? The time passed is less then 12 hours.​
helppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
For science project , 3/4 of the students chose to make a póster and 0.25 of the students wrote a report.Rosa said that more students nade a póster tan wrote a
The gastrointestinal (GI) tract begins at the mouth and extends to which of the following?
complete the equation of the line through (-8,8) and (1,-10).
Which statement best describes the relationship between food waste and climate change A. Reducing food waste contributes to the creation of heat-trapping emiss
Who wants 35 points????
Comparing SAT scores earned in high school with the first semester college GPA of that same student is a process related to establishing the ________ validity o