码迷,mamicode.com
首页 >  
搜索关键字:iteration order    ( 18206个结果
[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
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
经典算法宝典——迭代思想(二)(1)
迭代法(Iteration)也称“辗转法”,是一种不断用变量的旧值递推出新值的解决问题的方法。...
分类:其他好文   时间:2014-05-12 14:56:47    阅读次数:297
【LeetCode】Convert Sorted List to Binary Search Tree
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.1. 将LinkedList的值保存到一个数组中,转化成Convert Sorte...
分类:其他好文   时间:2014-05-12 05:53:09    阅读次数:367
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
mysql limit性能问题
offset大的时候的比较SELECT * FROM persons LIMIT 200000,10;耗时0.078sSELECT *FROM persons WHERE id>=(SELECT id FROM persons ORDER BY id LIMIT 200000,1) LIMIT 10...
分类:数据库   时间:2014-05-11 16:23:57    阅读次数:322
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!