题目: 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 farthe ...
分类:
其他好文 时间:
2017-07-22 14:30:39
阅读次数:
155
Lowest Common Ancestor of a Binary Search Tree 一、题目描写叙述 二、思路及代码 二叉搜索树有个性质:左子树的值都比根节点小,右子树的值比根节点大。那么我们的思路就是递归比較。 假设输入的两个节点的值比当前节点小,说明是在当前根节点的左子树中;反之则在右 ...
分类:
其他好文 时间:
2017-07-22 14:27:09
阅读次数:
208
You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be rep ...
分类:
其他好文 时间:
2017-07-22 11:00:41
阅读次数:
165
https://leetcode.com/problems/maximal-square/#/description Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1 ...
分类:
其他好文 时间:
2017-07-22 00:06:35
阅读次数:
203
【107-Binary Tree Level Order Traversal II(二叉树层序遍历II)】 【LeetCode-面试算法经典-Java实现】【全部题目文件夹索引】 原题 Given a binary tree, return the bottom-up level order tra ...
分类:
编程语言 时间:
2017-07-21 23:25:59
阅读次数:
226
(binary search trees) which form the basis of modern databases and immutable data structures. Binary search works very much the way humans intuitively ...
分类:
其他好文 时间:
2017-07-21 20:49:25
阅读次数:
143
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 l ...
分类:
其他好文 时间:
2017-07-21 19:00:37
阅读次数:
159
算法 STL算法部分主要由头文件<algorithm>,<numeric>,<functional>组成。要使用 STL中的算法函数必须包括头文件<algorithm>,对于数值算法须包括<numeric>,<functional>中则定义了一些模板类,用来声明函数对象。 分类 STL中算法大致分为 ...
分类:
编程语言 时间:
2017-07-21 13:23:56
阅读次数:
211
在用csv.writer写入文件的时候发现中间有多余的空行。 最早打开方式只是‘w’,会出现多余的空行,网上建议使用binary形式‘wb’打开可以解决问题: 不过只能在python2下运行,python3报错: 有人建议用encode(‘utf-8’)编码转变格式,但是觉得还是比较繁琐,因为lis ...
分类:
其他好文 时间:
2017-07-21 10:38:35
阅读次数:
244
Redis https://github.com/MSOpenTech/redis/releases 1:首先下载redis。 从下面地址下:https://github.com/MSOpenTech/redis/releases 2:创建redis.conf文件: 这是一个配置文件,指定了redi ...
分类:
其他好文 时间:
2017-07-20 16:27:39
阅读次数:
197