
I suppose answer is kn? But when I try drawing the tree, it looked like

So I must have done something wrong in the more detailed analysis?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First, your work list has length
k+2when it should probably have lengthk. My guess is that you meant to run fromnton-(k-1) = n-k+1.Now if you want to sum consecutive numbers, the easiest is to remember (or derive) the formula
Use this to figure out that the sum you’re after is
as you correctly found. Now, think about big O. Since
n>k, we knownk > k^2, so the latter term is really a lower term, and the whole thing isO(nk).