#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : guangxu.qi
# @Time : 2020/10/23 10:28
# @FileName: selection_sort.py
# @Description:
def selection_sort(alist):
for i in range(len(alist) - 1):
index = 0
for j in range(1, len(alist) - i):
if alist[j] > alist[index]:
index = j
alist[j], alist[index] = alist[index], alist[j]
if __name__ == '__main__':
alist = [5, 3, 1, 4, 2, 3]
selection_sort(alist)
print(alist)