1.實現(xiàn)環(huán)境
- windows7
- python 3.6.5
- Sublime Text3
2.簡介
這篇文章,簡單介紹了如何使用Python語言實現(xiàn)一個簡單的算法探查器底燎。
這里面主要用到了兩個外部模塊profiler弹砚,algorithms
3.實現(xiàn)
from profiler import profiler
from algorithms.sort import selection_sort
import random
#創(chuàng)建一個無序的列表
p = profiler()
test = [x for x in range(1000)]
random.shuffle(test)
#算法探查
p.start()
selection_sort(test)
p.end()