Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
5_homework_yangpeng
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨鹏
5_homework_yangpeng
Commits
ac4e14e3
Commit
ac4e14e3
authored
Jan 14, 2019
by
杨鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
39e7d06a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
reg_utils.py
+4
-4
No files found.
reg_utils.py
View file @
ac4e14e3
...
@@ -50,9 +50,9 @@ class SortUtils:
...
@@ -50,9 +50,9 @@ class SortUtils:
def
sort
(
self
,
list_strs
,
order_method
):
def
sort
(
self
,
list_strs
,
order_method
):
if
order_method
==
"bubble"
:
if
order_method
==
"bubble"
:
SortUtils
.
__bubble_sort
(
list_strs
)
self
.
__bubble_sort
(
list_strs
)
if
order_method
==
"quick"
:
if
order_method
==
"quick"
:
SortUtils
.
__quick_sort
(
list_strs
,
0
,
len
(
list_strs
)
-
1
)
self
.
__quick_sort
(
list_strs
,
0
,
len
(
list_strs
)
-
1
)
def
__bubble_sort
(
self
,
list_strs
):
def
__bubble_sort
(
self
,
list_strs
):
for
i
in
range
(
len
(
list_strs
)
-
1
):
for
i
in
range
(
len
(
list_strs
)
-
1
):
...
@@ -79,8 +79,8 @@ class SortUtils:
...
@@ -79,8 +79,8 @@ class SortUtils:
print
(
"i="
+
str
(
i
)
+
"&&&"
+
"j="
+
str
(
j
)
+
"$$$"
+
"sort_list="
+
str
(
liststrs
))
print
(
"i="
+
str
(
i
)
+
"&&&"
+
"j="
+
str
(
j
)
+
"$$$"
+
"sort_list="
+
str
(
liststrs
))
liststrs
[
i
],
liststrs
[
start_index
]
=
liststrs
[
start_index
],
liststrs
[
i
]
liststrs
[
i
],
liststrs
[
start_index
]
=
liststrs
[
start_index
],
liststrs
[
i
]
SortUtils
.
__quick_sort
(
liststrs
,
start_index
,
i
-
1
)
self
.
__quick_sort
(
liststrs
,
start_index
,
i
-
1
)
SortUtils
.
__quick_sort
(
liststrs
,
i
+
1
,
end_index
)
self
.
__quick_sort
(
liststrs
,
i
+
1
,
end_index
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment