美文网首页
简单实现-算法探查器[Python]

简单实现-算法探查器[Python]

作者: 清新灬薄荷叶 | 来源:发表于2018-11-08 17:05 被阅读0次

    1.实现环境

    • windows7
    • python 3.6.5
    • Sublime Text3

    2.简介

    这篇文章,简单介绍了如何使用Python语言实现一个简单的算法探查器。
    这里面主要用到了两个外部模块profiler,algorithms

    3.实现

    from profiler import profiler
    from algorithms.sort import selection_sort
    import random
    #创建一个无序的列表
    p = profiler()
    test = [x for x in range(1000)]
    random.shuffle(test)
    #算法探查
    p.start()
    selection_sort(test)
    p.end()
    

    相关文章

      网友评论

          本文标题:简单实现-算法探查器[Python]

          本文链接:https://www.haomeiwen.com/subject/ifwwxqtx.html