Cho thuật toán sắp xếp Bubble Sort như sau: void BubbleSort(int M[], int N) { for (int I = 0; I < N-1; I++) for (int J = N-1; J > I; J--)
4/20
Cho thuật toán sắp xếp Bubble Sort như sau: void BubbleSort(int M[], int N) { for (int I = 0; I < N-1; I++) for (int J = N-1; J > I; J--) if (M[J] < M[J-1]) Swap(M[J], M[J-1]); return; } Chọn câu đúng nhất cho hàm Swap
void Swap(int &X, int &Y) { int Temp = X; X = Y; Y = Temp; return; }
void Swap(float X, floatY) { int Temp = X; X = Y; Y = Temp; return; }
void Swap(int *X, int *Y) { int Temp = X; X = Y; Y = Temp; return; }
void Swap(int X, intY) { int Temp = X; X = Y; Y = Temp; return; }