Skip to content

Commit 4d09d57

Browse files
authored
Update 1.bubbleSort.md
1 parent 7a268f4 commit 4d09d57

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

1.bubbleSort.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,16 @@ function bubbleSort($arr)
133133
```c
134134
void BubbleSort1(int data[],int n) //n为data长度
135135
{
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-
}
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+
}
146145
}
146+
}
147147
}
148148
```

0 commit comments

Comments
 (0)