Lab_Assignment-9
Lab_Assignment-9
7. Write a program to implement insertion sort algorithm for sorting an already sorted
array. Then sort the array in descending order. Compare both the approaches and print
your analysis as output.
8. Write a program to implement binary search to find a string. Given a sorted array of
String and a String x, find index of x if it is present in the array else return -1.
9. Write a recursive function to implement linear search algorithm. The function should
receive an integer array, the size of the array and the search key as arguments. If the
search key is found, return the array subscript, else return -1.
10. Write a recursive function to implement binary search algorithm. The function should
receive an integer array, the starting subscript, the ending subscript and the search key
as arguments. If the search key is found, return the array subscript, else return -1.