码迷,mamicode.com
首页 >  
搜索关键字:two pointers    ( 12138个结果
Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ...
分类:其他好文   时间:2014-05-16 23:18:16    阅读次数:360
不用js实现幻灯片功能
one two three four five six seven eight
分类:Web程序   时间:2014-05-16 20:49:04    阅读次数:340
【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 endpoints of ...
分类:其他好文   时间:2014-05-16 19:42:17    阅读次数:286
[记忆化搜索] zoj 3681 E - Cup 2
题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3681 E - Cup 2 Time Limit: 2 Seconds      Memory Limit: 65536 KB The European Cup final is coming. The past two World C...
分类:其他好文   时间:2014-05-15 14:56:27    阅读次数:393
Multi-Thread 1: how to use synchronized
1. synchronized If two threads are using the same function( here we use output to print out string) of another instance, if we want to make sure that these two threads are not disturbing each other. ...
分类:其他好文   时间:2014-05-15 11:14:14    阅读次数:389
Leetcode 树 Populating Next Right Pointers in Each Node
题意:给定一棵perfect binary tree,将它每一个节点的next指针都指向该节点右边的节点 思路:dfs 在connect一棵树的时候,需要知道这棵树的根节点和它右边的节点 1.将树的根节点和它右边的节点连接起来 2.递归地将左子树connect起来,需要知道左子树节点和右子树节点 3.递归地将右子树connect起来,需要知道右子树节点和根右边的节点的左子树节点 递归函数为: void connect(TreeLinkNode *root, TreeLinkNode *sibling) 表...
分类:其他好文   时间:2014-05-15 07:14:04    阅读次数:289
Hive常用命令
创建表: hive> CREATE TABLE pokes (foo INT, bar STRING);          Creates a table called pokes with two columns, the first being an integer and the other a string 创建一个新表,结构与其他一样 hive> create table n...
分类:其他好文   时间:2014-05-15 07:07:58    阅读次数:303
Leetcode 树 Populating Next Right Pointers in Each Node II
题意:给定一棵任意二叉树(不一定是perfect binary tree),将它每一个节点的next指针都指向该节点右边的节点 思路:bfs 这里不能用dfs了,只能用bfs bfs遍历将同一层的节点存放在同一个数组里, 然后在遍历每个数组,将前面的节点和后面的节点connect起来, 最后一个节点和NULL connect起来 需要定义一个新的struct结构,保存指向每个节点的指针和该节点所在的层 复杂度:时间O(n), 空间O( n)...
分类:其他好文   时间:2014-05-15 06:12:13    阅读次数:294
JSP_include指令和<jsp:include>
包含三个文件:jsp_include.jsp, static.html, two.jsp 环境:tomcat7.0, myeclipse10 1.jsp_include.jsp goto two--> this examples show include works '/> '/> 2.static.html...
分类:Web程序   时间:2014-05-14 14:27:53    阅读次数:334
[ACM] 1016 Prime Ring Problem (深度优先搜索)
Prime Ring Problem Problem Description A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent...
分类:其他好文   时间:2014-05-13 11:54:17    阅读次数:444
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!