码迷,mamicode.com
首页 >  
搜索关键字:level order    ( 23817个结果
[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
Pat(Advanced Level)Practice--1018(Public Bike Management)
Pat1018代码 题目描述: There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any station and return it to an...
分类:其他好文   时间:2014-05-13 23:27:04    阅读次数:582
Pat(Advanced Level)Practice--1016(Phone Bills)
Pat1016代码 题目描述: A long-distance telephone company charges its customers by the following rules: Making a long-distance call costs a certain amount per minute, depending on the time of day w...
分类:其他好文   时间:2014-05-13 06:45:05    阅读次数:460
Mysql的ORDER BY 和Limit offset的一个问题,拿出来和大家研究下
今天碰到个很怪异的问题,如题关于mysql的ORDERBY语句和Limitoffset语句问题。bug再现下:select*fromAawherea.culomn1limit5offset0orderbya.culomn1asc则出现sqlException,提示orderby这行有问题。若将语句改为如下,将limit语句和orderby语句调换:select*fromAawherea.cul..
分类:数据库   时间:2014-05-13 01:14:39    阅读次数:344
[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】Spiral Matrix
Spiral MatrixGiven a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[...
分类:其他好文   时间:2014-05-12 20:04:43    阅读次数:268
【LeetCode】Spiral Matrix II
Given an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the following matri...
分类:其他好文   时间:2014-05-12 19:53:23    阅读次数:332
ZOJ 1151 Word Reversal反转单词 (string字符串处理)
链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=151 For each list of words, output a line with each word reversed without changing the order of the words. This problem contains multi...
分类:其他好文   时间:2014-05-11 22:20:43    阅读次数:443
设计模式中的六大设计原则之三,四
3.依赖倒置原则:High level modules should not depend upon low level modules. Both should depend upon abstractions. Abstractions should not depend upon details. Details should depend upon abstractions. 意思是:高...
分类:其他好文   时间:2014-05-11 22:15:36    阅读次数:326
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!