how to write a recurrence relation for a given piece of code

Okay, so in algorithm analysis, a recurrence relation is a function relating the amount of work needed to solve a problem of size n to that needed to solve smaller problems (this is closely related to its meaning in math). For example, consider a Fibonacci function below: This does three operations (comparison, comparison, addition), and … Read more