Recursion
Problem Set 7.1: Recursion (Class)
Printing Series
Print Hello World N Times
1, 2, 3, 4, ⋯⋯⋯, N
1, 3, 5, 7, ⋯⋯⋯, 99
2, 4, 6, 8, ⋯⋯⋯, N
N, N-1, N-2, …, 3, 2, 1
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ⋯⋯⋯, N (Calculate the Fibonacci series up to Nth term or up to N using recursion)
Summation of Series
1 + 2 + 3 + 4 + ⋯⋯ + N
1 + 3 + 5 + 7 + ⋯⋯⋯ + N
2 + 4 + 6 + 8 + ⋯⋯⋯ + N
1^2 + 3^2 + 5^2 + 7^2 + ⋯⋯⋯ + (101)^2
2^3 + 4^3 + 6^3 + 8^3 + ⋯⋯⋯ + N^3
N! = 1 * 2 * 3 * 4 * ⋯⋯⋯ * N
Array
Define a recursive function that takes an integer array as an argument and prints the array elements.
Define a recursive function that takes an integer array as an argument and prints the array elements in reverse order.
Reverse the array
Implement Linear Search using recursion
Implement Binary Search using recursion
Search an element (Key, Maximum, Minimum, Second Maximum, and Second Minimum) in an array using recursion
Find the Key Value that exists or not in an array using recursion (Return true or false)
Find the Key Value that exists or not in an array using recursion (Return the index if found otherwise return -1)
Find the minimum number from an array using recursion
Find the maximum number from an array using recursion
Find the minimum number from an array using recursion
Print Array elements in pairs of first and last elements and so on
Others
Implement Euclidean Algorithm to Calculate Greatest Common Divisor (GCD) using recursion
Least Common Multiple (LCM)
Palindrome Checker
Print an Integer in reverse order using recursion
Print String using recursion
Print String in reverse order using recursion
Reverse String using recursion
Tower of Hanoi
Calculate a^b using recursion
Calculate a^b % c using recursion
Calculate sqrt(a) using recursion
Base Conversion
Decimal to Binary
Binary to Decimal
Decimal to Octal
Decimal to Hexadecimal
Decimal to Base N Number
Octal to Decimal
Hexadecimal to Decimal
Base N Number to Decimal
Exercise:
Last updated