提交 fdd9d4d8 创建 作者: 宋海霞's avatar 宋海霞

modify

上级 0f3e2c86
...@@ -12,12 +12,12 @@ int main(int argc, char* argv[]) ...@@ -12,12 +12,12 @@ int main(int argc, char* argv[])
int length = sizeof(list) / sizeof(list[0]); // Calculate the linear table length int length = sizeof(list) / sizeof(list[0]); // Calculate the linear table length
// //
// 冒泡排序.按关键字递增排序. // Bubble sort.Sort by keyword increments.
// //
BubbleSort(list, length); BubbleSort(list, length);
// //
// 输出排序后的结果 // Output the sorted result
// //
for(i=0; i<length; i++) for(i=0; i<length; i++)
printf("%d ", list[i]); printf("%d ", list[i]);
...@@ -27,7 +27,7 @@ int main(int argc, char* argv[]) ...@@ -27,7 +27,7 @@ int main(int argc, char* argv[])
/* /*
function: function:
冒泡排序.按关键字递增排序. Bubble sort.Sort by keyword increments.
parameter: parameter:
list -- Linear table pointer list -- Linear table pointer
...@@ -35,10 +35,10 @@ parameter: ...@@ -35,10 +35,10 @@ parameter:
*/ */
void BubbleSort(int* list, int length) void BubbleSort(int* list, int length)
{ {
int temp; // 用于交换的临时变量 int temp; // Temporary variables for exchange
int i; // The cursor int i; // The cursor
int j; // 控制每趟排序比较的次数 int j; // Control the number of sorting comparisons per run
int flag; // 0 表示排序未完成;1 表示排序已完成 int flag; // 0 means the sort is not complete;1 indicates that the sort is complete
// //
// TODO: Add the code here // TODO: Add the code here
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论