Home > Back-end >  Great god teach thank you I am a novice, helping to find a teacher, I will learn by heart
Great god teach thank you I am a novice, helping to find a teacher, I will learn by heart

Time:09-29

Why can compile, the download and pass it?







#include
# define SIZE 10

Void the bubbleSort (int x, int);

The main ()
{
Int I, a [SIZE]=,6,4,8,10,12,89,68,45,37 {2};

Printf (" the Data items in the original order \ n ");

for(i=0; I<=the SIZE - 1; I++)
Printf (" % 4 d ", a [I]);

The bubbleSort (a, SIZE);
Printf (" \ nData items in ascending order \ n ");

for(i=0; I<=the SIZE - 1; I++)
Printf (" % 4 d ", a [I]);

printf("\n");
return 0;
}
Void bulleSort (int * array of const int size)
{
Int pass, j;
Void swap (int x, int *);



For (pass=1; Pass<=the size - 1; Pass++)
for(j=0; J<=the size - 2; J++)

If (array [j] & gt; Array [j + 1])
Swap (& amp; Array [j], & amp; Array [j + 1));
}
Void swap (int * element1Ptr, int * element3Ptr)

{

int temp;
Temp=* element1Ptr;
* element1Ptr=* element3Ptr;
* element3Ptr=temp;
}

CodePudding user response:

Compilation can pass, because you said earlier the
 void the bubbleSort (int x, int); 

And link not through because you are
 void the bubbleSort (int x, int); 
the name of the implementation of the change to become
 bulleSort 

  • Related