Awesome q2a theme
0 votes

What is the recurrence equation and how to solve it?

in Algorithms by (16 points) | 12 views
T(n) = T(n-1) + T(n-2) + c;

This is the recurrence for Fibonacci, which has an exponential running time.

1 Answer

0 votes
This program is used for Fibonacci Series

Recurrence Equation of this is

$T(n)= \begin{Bmatrix} n & n<=1\\ T(n-1)+T(n-2) & n>1 \end{Bmatrix}$

You can make Tree.. And when you make tree, height  of tree will be $n$ in worst case(n-1) and there will be $O(2^n)$ leaf nodes. To get ans of $f(n)$ you  have to add all those leaf node and operation take constant time.

So, Time complexity of this function $O(2^n)$.

Correct if  i am wrong.
by (64 points)
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Top Users Feb 2020
  1. shashin

    363 Points

  2. Shaik Masthan

    79 Points

  3. SuvasishDutta

    39 Points

  4. srestha

    33 Points

  5. Mk Utkarsh

    32 Points

  6. neeraj_bhatt

    31 Points

  7. !KARAN

    30 Points

  8. Debapaul

    23 Points

  9. Pratyush Priyam Kuan

    18 Points

  10. kalra05

    18 Points

Monthly Top User and those within 60% of his/her points will get a share of monthly revenue of GO subject to a minimum payout of Rs. 500. Current monthly budget for Top Users is Rs. 75.
3,331 questions
1,581 answers
89,916 users