// Function to search data using jump search #include #include using namespace std; int jumpSearch(int arr[], int n, int key) { int start = 0; int end = sqrt(n); //the square root of array length while (arr[end] <= key && end < n) { start = end; //if it is not correct block then shift block end += sqrt(n); if (end > n - 1) end = n; //if right exceeds then bound the range } for (int pos = start; pos < end; pos++) { //perform linear search if (arr[pos] == key) return pos; //the correct position of the key } return -1; // if element is not found } //recursive jump search function to search data in an array int recursive_jump_search(int *arr,int start,int end,int n,int to_search,int jump) { // if end index of n is greater than n that means data not found so return -1 if(end>n) return -1; // is the element to search is greater than end index and end index is less than n than we need to jump else if(arr[end]> n; int arr[n]; cout << "Enter the elements of array:"<> arr[i]; // Taking input cout << "Enter search key: "; cin >> key; //Calling of jumpSearch function and getting a location back cout<<"Iterative Solution:"<