Lab 2: Recursion
Task 1
Complete the implementation below to print an array recursively
void print(int[] A, int start){
//toDo
}
Task 2
Complete the implementation below to print an array in reverse order recursively example:
int A[] ={1,2,3,4}; print_Reverse(A,0) ==> 4 3 2 1 print_Reverse(A,2) ==> 4 3
void print_Reverse(int[] A, int start){
//toDo
}
Task 3
Implement a recursive method that convert a decimal number to a base b
void convert (int n, int b){
//toDo
}
Task 4
If a string reversed value is equal to the original string then this string is PALINDROME, implement a recursive method to check if a string given as parameter is palindrome or not:
boolean palindrome(String s)
{
//toDo
}
Task 5
Implement a recursive method that reverse a string:
String reverse(String s)
{
//toDo
}
Task 6
Implement a recursive method that search the minimum value in an array of integers:
int min(int[] A, int start){
//toDo
}
Task 7
Implement the binary search algorithm using recursion:
int binarySearch(int[] A, int start, int end, int key){
//toDo
}