Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - The algorithm is described by C++ function, and the time complexity is obtained.
The algorithm is described by C++ function, and the time complexity is obtained.
# include & ltiostream.h & gt

int max=0,may = 0;

int array[5][5];

void ReMax()

{

int i,j;

///Bubble method, time complexity is 5*5.

for(I = 0; I<5; i++)

for(j = 0; j & lt5; j++)

if(array[max][may]& lt; array[I][j+ 1]){ max = I; may = j+ 1; }

}

void main(){

int i,j;

//* a =(int *)malloc(5 * size of(int));

Cout & lt& lt "Please enter an array array [5] [5]:"

for(I = 0; I<5; i++)

for(j = 0; j & lt5; j++)

CIN & gt; & gtarray[I][j];

ReMax();

Cout & lt& lt "Maximum coordinates:"

}