[Python] Quick_sort 구현 - non-iterative, sorted before recursio
import time from typing import MutableSequence def qsort(a: MutableSequence, left : int, right : int) -> None: pl = left pr = right pivot = a[(left+right) // 2] while pl pivot: pr -= 1 if pl None: """퀵 정렬 시작""" print(quick_sort.__doc__) qsort(a, 0, len(a)-1) if __name__ == "__main__": start = time.time() data = [3,1,-5,7,-4,2,6,200,9,-2,4,3,0,-2] + [100] * 100000 quick_sort(data) sum = 0 for _, ..
컴퓨터/파이썬 공부정리
2020. 11. 10.