14
Задача
Java Collections, ниво, урок
Fibonacci numbers using recursion
Read about Fibonacci numbers.
Implement a recursive fibonacci method, where n is the number of an element in the Fibonacci sequence.
Don't create additional fields in the Solution class.
8
Задача
Java Collections, ниво, урок
Factorials using recursion
Read about how to calculate factorials.
Implement a recursive factorial method, where n is the number whose factorial needs to be calculated.
Don't create additional fields in the Solution class.
14
Задача
Java Collections, ниво, урок
Factorization using recursion
Separate the whole number n, where n > 1, into its prime factors.
Display all of its factors in ascending order, separated by spaces.
Write a recursive method to calculate the prime factors.
Don't create additional fields in the Solution class.
14
Задача
Java Collections, ниво, урок
Recursion for mathematical expressions
The input is a mathematical expression in the form of a String.
The expression may include whole numbers, fractional numbers, parentheses (), spaces, negative signs -, exponents ^, sin(x), cos(x), and tan(x).
14
Задача
Java Collections, ниво, урок
Tower of Hanoi
There are three rods. There are numRings rings stacked on rod A. Each ring has a different size and they're stacked from smallest
to largest (largest on the bottom). You need to move the pyramid of numRings rings from rod A to rod B in as few moves as possible.