Skip to content

Commit 7303a64

Browse files
Merge pull request geekcomputers#625 from NickTheBit/master
Removed quick_sort.py
2 parents 9e4f930 + c83ccde commit 7303a64

File tree

3 files changed

+13
-33
lines changed

3 files changed

+13
-33
lines changed

Quick_Sort.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# Python program for implementation of Quicksort Sort
1+
# Python program for implementation of Quicksort Sort
2+
3+
# This function takes last element as pivot, places
4+
# the pivot element at its correct position in sorted
5+
# array, and places all smaller (smaller than pivot)
6+
# to left of pivot and all greater elements to right
7+
# of pivot
8+
29

3-
# This function takes last element as pivot, places
4-
# the pivot element at its correct position in sorted
5-
# array, and places all smaller (smaller than pivot)
6-
# to left of pivot and all greater elements to right
7-
# of pivot
810
def partition(arr, low, high):
911
i = (low - 1) # index of smaller element
1012
pivot = arr[high] # pivot
@@ -22,12 +24,12 @@ def partition(arr, low, high):
2224
return (i + 1)
2325

2426

25-
# The main function that implements QuickSort
26-
# arr[] --> Array to be sorted,
27-
# low --> Starting index,
28-
# high --> Ending index
27+
# The main function that implements QuickSort
28+
# arr[] --> Array to be sorted,
29+
# low --> Starting index,
30+
# high --> Ending index
2931

30-
# Function to do Quick sort
32+
# Function to do Quick sort
3133
def quickSort(arr, low, high):
3234
if low < high:
3335
# pi is partitioning index, arr[p] is now

prog.py

Whitespace-only changes.

quick_sort.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)