Explain Fibonacci Sequence ? 


==> Fibonacci Sequence---

        Fibonacci series 0,1,1,2,3,5,8,13,21,…..

  1. if n=0 or n=1, then Fn =n
  2. if n>1 then Fn=Fn-1+Fn-2

         fib(n)

        {

         if(n==0)

         return 0;

         if(n==1) return 1;

         else

         return( fib(n-1)+fib(n-2));

          } 



Share to whatsapp

More Questions from Data Structures and Algorithms Module 2

Explain Dequeues- Double Ended Queues ? 


View

Define Priority Queue. Explain Application and implementation of Priority Queue ? 


View

Explain briefly Infix expression, Polish Notation and Reverse Polish Notation ?


View

Explain simple queue ? Brief disadvantages of simple queue.


View

Explain Factorial of a number ? 


View

Explain about Implementation of Queue ? 


View

Explain Algorithm for Enqueue operation  and Algorithm for Dequeue operation using array ? 


View