递归
Data Structures & Algorithms · 3 notes
- Jump Floorhistorical
A frog can jump either 1 step or 2 steps at a time. Find the total number of ways the frog can jump up a staircase with n steps (different orders count as different results).
- Jump Floor IIhistorical
A frog can jump 1 step at a time, 2 steps at a time... or even n steps at a time. Find the total number of ways the frog can jump up a staircase with n steps.
- Fibonacci Sequencehistorical
Given an integer n, output the nth item of the Fibonacci sequence (starting from 0, where the 0th item is 0 and the 1st item is 1).