We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd6155a commit 7a268f4Copy full SHA for 7a268f4
1.bubbleSort.md
@@ -129,3 +129,20 @@ function bubbleSort($arr)
129
return $arr;
130
}
131
```
132
+## 10. C 代码实现
133
+```c
134
+void BubbleSort1(int data[],int n) //n为data长度
135
+{
136
+ int t;
137
+ for(int i=0;i<n-1;i++){
138
+ for(int j=0;j<n-i-1;j++){
139
+ if(data[j] > data[j+1])
140
+ {
141
+ t = data[j+1];
142
+ data[j+1] = data[j];
143
+ data[j] = t;
144
+ }
145
146
147
+}
148
+```
0 commit comments