码迷,mamicode.com
首页 >  
搜索关键字:排序 python    ( 180003个结果
[leetcode]Binary Tree Level Order Traversal @ Python
原题地址:http://oj.leetcode.com/problems/binary-tree-level-order-traversal/题意:二叉树的层序遍历的实现。解题思路:二叉树的层序遍历可以用bfs或者dfs来实现。这里使用的dfs实现,代码比较简洁。实际上,二叉树的先序遍历就是dfs实...
分类:编程语言   时间:2014-05-14 03:25:59    阅读次数:428
[leetcode]Binary Tree Level Order Traversal II @ Python
原题地址:http://oj.leetcode.com/problems/binary-tree-level-order-traversal-ii/题意:Given a binary tree, return thebottom-up level ordertraversal of its node...
分类:编程语言   时间:2014-05-12 22:03:27    阅读次数:581
[leetcode]Binary Tree Zigzag Level Order Traversal @ Python
原题地址:http://oj.leetcode.com/problems/binary-tree-zigzag-level-order-traversal/题意:Given a binary tree, return thezigzag level ordertraversal of its nod...
分类:编程语言   时间:2014-05-12 22:02:26    阅读次数:480
[leetcode]Minimum Depth of Binary Tree @ Python
原题地址:http://oj.leetcode.com/problems/minimum-depth-of-binary-tree/题意:Given a binary tree, find its minimum depth.The minimum depth is the number of no...
分类:编程语言   时间:2014-05-12 21:55:15    阅读次数:348
Windows 下让 Python 多个版本共存(支持 pip)
转载自http://blog.kgzx.net/index.php/archives/40/因为类库兼容性的关系,写实际项目时都是用 Python 2,但自己试验性的写点小东西还是喜欢用 Python 3在这记录一下在 windows 下让这两个版本共存的配置步骤在官网下载两个版本的 exe 文件并...
分类:编程语言   时间:2014-05-12 21:48:04    阅读次数:354
[leetcode]Convert Sorted Array to Binary Search Tree @ Python
原题地址:http://oj.leetcode.com/problems/convert-sorted-array-to-binary-search-tree/题意:将一个排序好的数组转换为一颗二叉查找树,这颗二叉查找树要求是平衡的。解题思路:由于要求二叉查找树是平衡的。所以我们可以选在数组的中间那...
分类:编程语言   时间:2014-05-12 21:44:57    阅读次数:379
[leetcode]Convert Sorted List to Binary Search Tree @ Python
原题地址:http://oj.leetcode.com/problems/convert-sorted-list-to-binary-search-tree/题意:将一条排序好的链表转换为二叉查找树,二叉查找树需要平衡。解题思路:两个思路:一,可以使用快慢指针来找到中间的那个节点,然后将这个节点作为...
分类:编程语言   时间:2014-05-12 21:07:00    阅读次数:405
UVa 10152 龟壳排序
思路:先读入的一列是原始串,后读入的一列是目标串。最少操作次数的方式是,从下到上,只对原始串进行删除而不放到最上面能得到的目标串的以最下元素开头的最长子串,然后将目标串剩余的那些按序放在最上方,即按由下到上的顺序输出即可。 Code: //#define LOCAL #include #include #include char name[210][90]; char target[210]...
分类:其他好文   时间:2014-05-11 21:42:42    阅读次数:310
运维的我要学开发--Flask(1)
Flask默认使用的是Jinja2的模板引擎,下面将会介绍下Flask提供给模板的一些方法。#-*-coding:utf-8-*- #导入一些函数 fromflaskimportFlask fromflaskimportrender_template,g #创建一个app app=Flask(__name__) #创建一个装饰器 @app.route("/") @app.route("/index") defindex..
分类:其他好文   时间:2014-05-11 19:25:12    阅读次数:443
命令行执行python模块时提示包找不到的问题
庄稼人不是专职python开发的道友,虽然与python相识已多年,可惜相识不相知,只是偶尔借助pydev写一些简单的小工具。 多年来,一直困惑于这样一个问题:同样的工程,同样的代码,使用pydev可以运行任意一个python脚本,而使用命令行运行却不行?命令行下(或者双击执行)总是提示“ImportError: No module named xxx”?pydev究竟做了什么魔术呢? 长...
分类:编程语言   时间:2014-05-11 18:37:41    阅读次数:843
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!