Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
a definition of a sequence where later elements are expressed as a function of earlier elements.
3
votes
3
answers
3k
views
Finding recurrence relation for running time of an algorithm
I am pretty new to this, consider the following algorithm:
Calc_a(n):
if n ==1: return 1
else:
sum = 0
for i=1 to n-1:
sum = sum + calc_a(i)
return sum
So after running …