From 9ce3f7ae97ce7ac401324793830c44061ed3ee50 Mon Sep 17 00:00:00 2001 From: San983839 <54742391+San983839@users.noreply.github.com> Date: Sat, 12 Oct 2019 17:59:45 +0530 Subject: [PATCH] Update QuickSort.py --- QuickSort.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/QuickSort.py b/QuickSort.py index 4b3f497..2cb0788 100644 --- a/QuickSort.py +++ b/QuickSort.py @@ -2,7 +2,10 @@ import mysql.connector import datetime a = datetime.datetime.now() -def partition(arr,low,high): +def partition(arr,low,high): + + """Function to divide in two halves""" + i = ( low-1 ) pivot = arr[high] @@ -18,6 +21,9 @@ def partition(arr,low,high): return ( i+1 ) def quickSort(arr,low,high): + + #Function to quick sort + if low < high: