码迷,mamicode.com
首页 >  
搜索关键字:hdoj tree    ( 20544个结果
【leetcode】Populating Next Right Pointers in Each Node
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe...
分类:其他好文   时间:2014-07-22 23:16:35    阅读次数:373
UVALive 6577 Binary Tree 二叉树的LRU串
今天继续攒人品。。。真开心啊O(∩_∩)O~~各种身体不舒服~~https://icpcarchive.ecs.baylor.edu/external/65/6577.pdf题意是这样的,现在有一个向下无限延伸的二叉树。然后输入起点(通过只含LRU的字符串S,从根结点开始执行)。LRU分别表示往左儿...
分类:其他好文   时间:2014-07-22 23:15:54    阅读次数:550
【HDOJ】1198 Farm Irrigation
其实就是并查集,写麻烦了,同样的代码第一次提交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
[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
Maximum Depth of Binary Tree
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 le...
分类:其他好文   时间:2014-07-22 23:07:13    阅读次数:379
BST(Binary Search Tree)
Definition: see wikihttp://en.wikipedia.org/wiki/Binary_search_tree 1 /* 2 This look up is a fast operation because you eliminate the half 3 t...
分类:其他好文   时间:2014-07-22 23:06:34    阅读次数:330
[leetcode] Balanced Binary Tree
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth...
分类:其他好文   时间:2014-05-01 14:38:39    阅读次数:454
【HDOJ】3560 Graph’s Cycle Component
并查集的路径压缩。 1 #include 2 #include 3 4 #define MAXNUM 100005 5 6 int deg[MAXNUM], bin[MAXNUM]; 7 char isCycle[MAXNUM]; 8 9 int find(int x) {10 i...
分类:其他好文   时间:2014-04-29 17:22:46    阅读次数:308
【HDOJ】2473 Junk-Mail Filter
并查集删除结点,方法是构建虚拟点,做映射。 1 #include 2 #include 3 4 #define MAXNUM 1000050 5 6 int bin[MAXNUM], assist[MAXNUM]; 7 char visit[MAXNUM]; 8 int n, ext; 9 ...
分类:其他好文   时间:2014-04-29 17:12:47    阅读次数:385
HDOJ ---1711 Number Sequence
Number SequenceTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9899Accepted Submission(s): 4518Pr...
分类:其他好文   时间:2014-04-29 11:28:46    阅读次数:354
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!