diptangsu / Sorting-Algorithms

Expected 2 blank lines FLK-E302
Style
Minor
3 years ago4 years old
expected 2 blank lines, found 1
 5# array, and places all smaller (smaller than pivot)
 6# to left of pivot and all greater elements to right
 7# of pivot
 8def partition(arr, low, high): 9    i = (low - 1)         # index of smaller element
10    pivot = arr[high]     # pivot
11
expected 2 blank lines, found 1
26# high  --> Ending index
27
28# Function to do Quick sort
29def quick_sort(arr, low, high):30    if low < high:
31        # pi is partitioning index, arr[p] is now
32        # at right place
expected 2 blank lines, found 0
 1"""Python program for implementation of Insertion Sort
 2"""
 3def insertion_sort(arr): 4    # Traverse through 1 to len(arr)
 5    for i in range(1, len(arr)):
 6        key = arr[i]