CodeGym /Courses /Java Collections /Tasks | Level 4 | Lesson 2

Tasks | Level 4 | Lesson 2

Java Collections
Level 4 , Lesson 2
Available

"Hi, Amigo! I found some great tasks for you:"

14
Task
Java Collections, level 4, lesson 2
Locked
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
Task
Java Collections, level 4, lesson 2
Locked
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
Task
Java Collections, level 4, lesson 2
Locked
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
Task
Java Collections, level 4, lesson 2
Locked
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
Task
Java Collections, level 4, lesson 2
Locked
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.
Comments (6)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Hoist Level 3, San Diego, United States
8 January 2024
Output from A to B from A to C from B to C from A to B from C to A from C to B from A to B
Justin Smith Level 41, Greenfield, USA, United States
29 October 2022
Recursion for Mathematical Expressions should definitely be rated Hard. The official CG solution is over 300 lines long. Tower of Hanoi is probably appropriately rated, as an averaged difficulty based on whether or not you know the process for solving the real Tower of Hanoi puzzle or not. Unfortunately, I do not. If you give me the real Tower of Hanoi puzzle I do not know how to solve it, aside from trial and error. I skipped both of these two tasks. 😁
Thành Black Level 49, Hanoi
8 December 2021
Recursion for mathematical expressions. anyone can pass it
fzw Level 41, West University Place, United States
4 May 2020
Last one is MEDIUM??? Is this a joke???
BlueJavaBanana Level 37
2 March 2021
Haha, check out the "correct solution" they provide 300+ lines of code!
Weichen Ouyang Level 25, San Jose, United States
22 September 2019
This one should be considered to be classified as LeetCode Hard Problem.