Given a binary tree struct TreeLinkNode {
TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next
pointe...
分类:
其他好文 时间:
2014-07-22 23:16:35
阅读次数:
373
其实就是并查集,写麻烦了,同样的代码第一次提交wa了,第二次就过了。 1 #include 2
#include 3 4 #define MAXNUM 55 5 #define UP 0 6 #define RIGHT 1 7 #define DOWN 2
8 #def...
分类:
其他好文 时间:
2014-07-22 23:13:53
阅读次数:
310
/** * 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
简单最小生成树,继续我的kruskal#include#include#include#includeusing namespace std;const int
MAX=1000000;struct node{ int left,right,cost;}road[MAX];bool cmp(n...
分类:
其他好文 时间:
2014-05-01 09:28:42
阅读次数:
333
题目链接Given a list, rotate the list to the right
bykplaces, wherekis non-negative.For
example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.首...
分类:
其他好文 时间:
2014-05-01 04:52:19
阅读次数:
288
不能光转贴,有空要熟悉之后,要写点心得。现在发现 .
的优先级确实很高。C:PrecedenceOperatorDescriptionAssociativity1++--Suffix/postfix
increment and decrementLeft-to-right()Function cal...
分类:
编程语言 时间:
2014-04-29 21:56:50
阅读次数:
539
一、样式:二、js 三、html
div在浏览器窗口中的位置是,居上200px,居左200px。四、图示(top/left/right/bottom具体指示)
分类:
其他好文 时间:
2014-04-29 21:22:58
阅读次数:
477
hello everyone.This is a heading with no
positionThis heading is moved left according to its normal positionThis heading
is moved right according t...
分类:
Web程序 时间:
2014-04-29 15:47:14
阅读次数:
584
比如对于数组[1,-2,3,5,-1,2] 最大子数组和是sum[3,5,-1,2] = 9,
我们要求函数输出子数组和的最大值,并且返回子数组的左右边界(下面函数的left和right参数).本文我们规定当数组中所有数都小于0时,返回数组中最大的数(也可以规定返回0,只要让以下代码中maxsum初...
分类:
其他好文 时间:
2014-04-29 15:32:49
阅读次数:
554
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
Note: You can only move either down or right at...
分类:
其他好文 时间:
2014-04-28 10:46:41
阅读次数:
311