LeetCode第一题:Evaluate Reverse Polish Notation...
分类:
其他好文 时间:
2014-06-16 12:51:19
阅读次数:
152
原题地址:https://oj.leetcode.com/problems/remove-duplicates-from-sorted-list-ii/题意:Given
a sorted linked list, delete all nodes that have duplicate number...
分类:
编程语言 时间:
2014-06-16 10:40:35
阅读次数:
340
首先大概解释一下ChefChef有三个重要的概念:(如上图所示) 它们的合作关系大致是这样的,Workstation把资源或者说是一些要被运行的命令上传到Chef-Server上,Nodes自动通过Chef-Server拿到属于自己的执行任务到本地执行,这样可达到一个将军指挥千军万马的效果:smir...
分类:
其他好文 时间:
2014-06-15 22:46:55
阅读次数:
245
原题地址:https://oj.leetcode.com/problems/reverse-nodes-in-k-group/题意:Given a linked list, reverse the nodes of a linked listkat a time and return its mod...
分类:
编程语言 时间:
2014-06-15 21:24:43
阅读次数:
293
Given a binary tree, return the postorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [3,2,1].
Note: Recursive solut...
分类:
其他好文 时间:
2014-06-15 19:06:52
阅读次数:
166
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
此题和求二叉树的最短路径几乎一模一样。
public int...
分类:
其他好文 时间:
2014-06-15 16:36:40
阅读次数:
209
真的被这道题目恶心到了。。。281行代码。。。比一个模拟题还费事。。。
为了方便起见,在数列的前面和后面都加一个0点。
add x :把第k2+2个点旋转至root1.然后sum[root10]+=x;
reverse:把第k1+2个点旋转至root1.然后rev[root10]^=1;
insert x:得到第2个点,然后在第2个点之后插入x。
delete
:把第1个点旋...
分类:
其他好文 时间:
2014-06-14 00:54:26
阅读次数:
324
2 8 5 3 11.从后往前,找到第一个逆序的数
pivot2.从后往前,找到第一个比pivot大的数 change3.交换 pivot 和 change的值4.把pivot这个位置后面的数
reverse,就是 8 5 2 1变成 1 2 5 8最终为3 1 2 5 8#include #inc...
分类:
其他好文 时间:
2014-06-13 17:38:19
阅读次数:
378
Swap Nodes in Pairs:Given a linked list, swap every
two adjacent nodes and return its head.For example,Given1->2->3->4, you
should return the list as2...
分类:
其他好文 时间:
2014-06-13 17:04:27
阅读次数:
180