Add yourself to the entire program, which contains sort, rotate, find
#include <iostream>using namespace std;void my_sort (int a[],int len) {int temp;for (int i=0;i<len-1;i++) {for ( int j=0;j<len-1-i;j++) {if (a[j]>a[j+1]) {temp = A[j];a[j] = a[j+1];a[j+1] = temp;}}} void My_reverse (int a[],int m, int len) {int Temp;while (m>0) {temp = a[len-1];for (int i=len-2;i>=0;i--) {a[i+1] = A[i] ; }a[0] = temp;m--;}} void My_print (int a[],int len) {for (int i=0;i<len;i++) {cout<<a[i]<< "";} Cout<<endl;} int my_find (int a[],int low,int high) {int min = a[low];for (int i=low+1;i<=high;i++) {if (a[i]<min) {min = A[i];}} return min;} int my_min (int a[],int len) {int low = 0;int High = Len-1;int mid = Low;while (A[low]>=a[high]) {if (high-low = = 1) {return A[high];} Mid = (Low+high)/2;if (A[low]==a[mid]&&a[mid]==a[high]) return My_find (A,low,high), if (A[mid]>=a[low]) { Low = mid;} else if (A[mid]<=a[high]) {high = mid;}} if (A[low]<a[high]) {return a[low];}} int main () {int a[] = {1,1,1,1,0,1};int len = sizeof (a)/sizeof (a[0]); My_sort (A,len); My_print (A,len);cout<< "input the data for reverse:" <<endl;int m;cin>>m;my_reverse (A,m,len); my_ Print (a,len), int min = my_min (a,len);cout<< "min=" <<min<<endl;return 0;}
Minimum number of rotated array