Tuesday, August 13, 2013

Count possible ways to run up the stairs

Problem -  A person is running up a stair and can hop either 1 step, 2 step or 3 steps at a time. Implement a method to count how many ways the person can run up the stairs.

Solutions


Output-

Number of step 3831006429
 Elapsed Time using Recursion= 43119
 Number of step 3831006429

 Elapsed Time using DP= 2


1 comment:

  1. Give me the permission to update the solution. I want to write pseudo code and want to explain the solution.

    ReplyDelete