This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding: utf-8 | |
# Quicksort in Python | |
from random import randint | |
def sort(array): | |
def partition(array, left, right): | |
global swaps | |
# Improving worst case (at the cost of making average case suffer a little!) | |
#~ p = (left + right) // 2 |