https://leetcode.com/problems/sum-of-left-leaves/#/description Find the sum of all left leaves in a given binary tree. Example: Hint: Q: How to define ...
分类:
其他好文 时间:
2017-06-08 18:56:42
阅读次数:
176
1.Tld文件怎么新建?是干什么的? 1)New-->File(带后缀即可) 2)http://www.cnblogs.com/Maple-leaves/articles/4471043.html 2.关于格式化的日期(SimpleDateFormat&format&new Date()) 1)ht ...
分类:
其他好文 时间:
2017-05-20 18:28:15
阅读次数:
220
字典类型的字符串转成字典 - (NSDictionary *)parseJSONStringToNSDictionary:(NSString *)JSONString { NSData *JSONData = [JSONString dataUsingEncoding:NSUTF8StringEnc ...
分类:
其他好文 时间:
2017-05-16 17:21:14
阅读次数:
199
Given a binary tree, collect a tree's nodes as if you were doing this: Collect and remove all leaves, repeat until the tree is empty. Example: Given b ...
分类:
其他好文 时间:
2017-05-10 12:51:37
阅读次数:
136
Given a binary tree, return the values of its boundary in anti-clockwise direction starting from root. Boundary includes left boundary, leaves, and ri ...
分类:
其他好文 时间:
2017-05-10 01:04:46
阅读次数:
165
1、CentOS6.5 安装Python 的依赖包 yum groupinstall "Development tools"yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-dev ...
分类:
编程语言 时间:
2017-04-29 09:44:24
阅读次数:
258
原题链接在这里:https://leetcode.com/problems/find-leaves-of-binary-tree/#/description 题目: Given a binary tree, collect a tree's nodes as if you were doing th ...
分类:
其他好文 时间:
2017-04-21 09:27:16
阅读次数:
272
本来看着挺难的。大概是由于我多瞟了一眼题解,瞬间认为简单多了。做题就得这样,多自己想想。如今是 多校联赛,然而我并不会做。。。。慢慢来,一直在努力。 分析: 题上说了做多不会超过80行。所以能够开一个数组。这里我是把根节点作为第42个数,能够在建树的同一时候求 出那一列全部数值的和左孩子节点减一,右 ...
分类:
其他好文 时间:
2017-04-18 22:04:27
阅读次数:
136
统计每层的叶子节点个数建树,然后dfs即可 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <vector> using namespace std; /* 统计每层的叶子节 ...
分类:
其他好文 时间:
2017-04-18 15:06:17
阅读次数:
209