码迷,mamicode.com
首页 >  
搜索关键字:leetcode count prime    ( 54596个结果
小结
1. //取得结果集中行的数目示例:$count = mysql_num_rows($result1);2. //小括号里odd代表奇数,even代表偶数 示例:tr:nth-child(odd){ background: #cad9ea; }3.//Mysql数据库li...
分类:其他好文   时间:2014-07-22 23:11:33    阅读次数:423
[leetcode]Insertion Sort List @ Python
原题地址:http://oj.leetcode.com/problems/insertion-sort-list/题意:对链表进行插入排序。解题思路:首先来对插入排序有一个直观的认识,来自维基百科。 代码循环部分图示:代码:class Solution:# @p...
分类:编程语言   时间:2014-07-22 23:11:32    阅读次数:411
php mysql3
1 .count — 计算数组中的单元数目或对象中的属性个数 2 .limit 第几条开始(n-1) 显示几条(y) (n-1)* y =第几页3. css tr:nth_child(odd){ background :#red;} odd 奇数 even 偶数4 表单隐藏域:...
分类:数据库   时间:2014-07-22 23:10:14    阅读次数:389
Leetcode:Container With Most Water
戳我去解题Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoint...
分类:其他好文   时间:2014-07-22 23:09:34    阅读次数:337
LeetCode OJ - Word Ladder
我觉得这道题比较难,主要是因为对于我来说:1. 我没有把这个问题联想到树的宽度遍历(即便没有考虑树的宽度遍历,也是可以做的,但是我一开始实现的代码却是深度遍历,后来发现树的BFS一般使用queue实现的,貌似没有递归的方法??)2. 即使在意识到用BFS,却还有一个陷阱:我是对字典进行了BFS,这个...
分类:其他好文   时间:2014-07-22 23:08:55    阅读次数:305
Leetcode | Work Break
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For e...
分类:其他好文   时间:2014-07-22 23:08:32    阅读次数:383
[leetcode]Binary Tree Maximum Path Sum
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(...
分类:其他好文   时间:2014-07-22 23:07:34    阅读次数:312
[leetcode]Reorder List @ Python
原题地址:http://oj.leetcode.com/problems/reorder-list/题意:Given a singly linked listL:L0→L1→…→Ln-1→Ln,reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this...
分类:编程语言   时间:2014-05-01 15:37:03    阅读次数:441
LeetCode OJ - Word Ladder 2
我发现在leetcode上做题,当我出现TLE问题时,往往是代码有漏洞,有些条件没有考虑到,这道题又验证了我这一想法。这道题是在上一道的基础上进一步把所有可能得转换序列给出。同样的先是BFS,与此同时需要一个hashMap记录下每个节点,和他所有父节点的对应关系,然后通过DFS,回溯所有可能的路径。...
分类:其他好文   时间:2014-05-01 15:08:04    阅读次数:415
hdu 1239 找素数对
题意:给你一个大于4的整数m和一个真分数a/b,求最佳素数对p、q,使得a/b#includeusing namespace std; int main() { int prime[2000],k; int num[10001]; int i,l; int ...
分类:其他好文   时间:2014-05-01 14:43:18    阅读次数:325
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!