/* Function to reverse arr[] from start to end*/void rvereseArray(int arr[], int start, int end){ int temp; while (start < end) { temp = arr[start]; arr[start] = arr[end]; arr[end] = temp; start++; end--; } }
/* Function to reverse arr[] from start to end*/void rvereseArray(int arr[], int start, int end){ int temp; if (start >= end) return; temp = arr[start]; arr[start] = arr[end]; arr[end] = temp; rvereseArray(arr, start+1, end-1); }
Thanks raghu konda
ReplyDelete