Update quick_sort.py (#928) · zinating/algorithms-python@34889fc · GitHub
Skip to content

Commit 34889fc

Browse files
BruceLee569poyea
authored andcommitted
Update quick_sort.py (TheAlgorithms#928)
Use the last element as the first pivot, for it's easy to pop, this saves one element space. Iterating with the original list saves half the space, instead of generate a new shallow copy list by slice method.
1 parent be4150c commit 34889fc

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

sorts/quick_sort.py

Lines changed: 6 additions & 7 deletions

0 commit comments

Comments
 (0)