Skip to content

Commit 90203d8

Browse files
author
Vimal A R
authored
Update quick sort
1 parent bfcc678 commit 90203d8

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎Day-111/quick_sort.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#!/usr/bin/env python3
2+
3+
# Algorithm: Quick sort
4+
# Referrence: https://github.com/TheAlgorithms/Python/blob/master/sorts/quick_sort.py
5+
6+
7+
18
def quick_sort(num_list):
29
"""
310
Quick sort in Python
@@ -19,5 +26,5 @@ def quick_sort(num_list):
1926
return quick_sort(less_than) + [pivot] + quick_sort(greater_than)
2027

2128

22-
num_list = [9, 1, 2, 3, 8, 5, 4]
29+
num_list = [10, -1, 100, 23, 5, 98, 45, 76, -545, -300, 9999]
2330
print(quick_sort(num_list))

0 commit comments

Comments
 (0)