Commit ac4e14e3 by 杨鹏

update

parent 39e7d06a
......@@ -50,9 +50,9 @@ class SortUtils:
def sort(self,list_strs, order_method):
if order_method == "bubble":
SortUtils.__bubble_sort(list_strs)
self.__bubble_sort(list_strs)
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):
for i in range(len(list_strs) - 1):
......@@ -79,8 +79,8 @@ class SortUtils:
print("i=" + str(i) + "&&&" + "j=" + str(j) + "$$$" + "sort_list=" + str(liststrs))
liststrs[i], liststrs[start_index] = liststrs[start_index], liststrs[i]
SortUtils.__quick_sort(liststrs, start_index, i - 1)
SortUtils.__quick_sort(liststrs, i + 1, end_index)
self.__quick_sort(liststrs, start_index, i - 1)
self.__quick_sort(liststrs, i + 1, end_index)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment