GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Placement Papers  >  Infosys  >  Challenging Puzzles

 Print  |  
Question:  There is A staircase having n steps (odd or even). A person standing at the base Can take one or two-steps at a time. My query is in how many ways can The stairs can be climbed?




January 01, 2006 10:51:03 #8
 pradeep narra   Member Since: Visitor    Total Comments: N/A 

RE: There is A staircase having n steps (odd or even)....
 

If f(n) is the number of ways to climb n steps;

f(1)=1;

f(2)=2;

then f(n)=f(n-1)+f(n-2);

this is nothing but a fibonacci series 1,2,3,5,8,13,21,34,  and so on

     

 

Back To Question