All pastes #443553 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-04-16 21:26 UTC
rendered paste body
def selectionSort(subList):
    for start in range(len(subList)-1):
        bottom = start
        for index in range(start+1,len(subList)):
            if subList[index] < subList[bottom]:
                    bottom = index
            if bottom != start:
                temp = subList[start]
                subList[start] = subList[bottom]
                subList[bottom] = temp
    return subList