Ask Question

Give a recursive algorithm for finding the sum of the

first n odd positive integers.

+2
Answers (1)
  1. 17 May, 03:38
    0
    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
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Give a recursive algorithm for finding the sum of the first n odd positive integers. ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers