码迷,mamicode.com
首页 >  
搜索关键字:hdoj tree    ( 20544个结果
leetcode - Maximum Depth of Binary Tree
题目:Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the ro...
分类:其他好文   时间:2014-06-10 10:09:13    阅读次数:237
json tree
下载源码:http://files.cnblogs.com/Mr-Joe/tree.zip
分类:Web程序   时间:2014-06-10 09:58:11    阅读次数:187
【leetcode】Flatten Binary Tree to Linked List
分析: 问题是将给定的二叉树变换成令一种形式,这种类型的问题,其模式是,将左子树变换成某种形式,右子树也变换成这种形式,然后再与根结点按规定的方式连接起来,那么整体就变换完成了。这个题我们就可以采用这种形式,麻烦的地方就是在进行连接的时候,我们假设根为root,左子树变换后的根为root_left,右子树变换后的根为 root_right,那么连接的时候应该是root->right = root...
分类:其他好文   时间:2014-06-10 07:27:10    阅读次数:201
【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-06-10 00:54:41    阅读次数:313
【HDOJ】1606 Excuses, Excuses!
简单字符串。 1 #include 2 #include 3 4 #define MAXLEN 105 5 #define MAXN 25 6 7 char keys[MAXN][MAXN]; 8 char lines[MAXN][MAXLEN]; 9 int nums[MAXN];10...
分类:其他好文   时间:2014-06-09 19:29:31    阅读次数:190
[leetcode]Scramble String @ Python
原题地址:https://oj.leetcode.com/problems/scramble-string/题意:Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty su...
分类:编程语言   时间:2014-06-09 19:02:59    阅读次数:197
二叉树链式存储结构
二叉链表的C语言描述基本运算的算法——建立二叉链表、先序遍历二叉树、中序遍历二叉树、后序遍历二叉树、后序遍历求二叉树深度#include#includeusing namespace std;class Tree{private: struct Node { char da...
分类:其他好文   时间:2014-06-09 18:39:49    阅读次数:310
【HDOJ】1686 Oulipo
kmp算法。 1 #include 2 #include 3 4 char src[10005], des[1000005]; 5 int next[10005], total; 6 7 void kmp(char des[], char src[]){ 8 int ld = str...
分类:其他好文   时间:2014-06-09 17:46:37    阅读次数:264
Sentiment Analysis(1)-Dependency Tree-based Sentiment Classification using CRFs with Hidden Variables
The content is from this paper:Dependency Tree-based Sentiment Classification using CRFs with Hidden Variables, byTetsuji Nakagawa.A typical approach ...
分类:其他好文   时间:2014-06-09 16:39:56    阅读次数:421
[leetcode] 22.Same Tree
同是递归简单题public class Solution { public boolean isSameTree(TreeNode p, TreeNode q) { boolean flag = true; if(p == null && q == null) ...
分类:其他好文   时间:2014-06-09 13:46:23    阅读次数:275
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!