Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cbc9a8c

Browse files
Fix
1 parent f3e55d5 commit cbc9a8c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

‎5.mergeSort.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,15 @@ function merge(left, right)
7272
}
7373
```
7474

75-
## 4. Python 代码实现
75+
## 5. Python 代码实现
7676

7777
```python
7878
def mergeSort(arr):
7979
import math
8080
if(len(arr)<2):
8181
return arr
8282
middle = math.floor(len(arr)/2)
83-
left = arr[0:middle]
84-
right = arr[middle:]
83+
left, right = arr[0:middle], arr[middle:]
8584
return merge(mergeSort(left), mergeSort(right))
8685

8786
def merge(left,right):

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /