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 ...
分类:
其他好文 时间:
2018-10-09 21:36:02
阅读次数:
138
参考:《STL源码剖析》第6章 算法 include include include / / template T accumulate(InputIterator first, InputIterator last, T init) { for (; first != last; ++first) ...
分类:
编程语言 时间:
2018-10-09 20:03:20
阅读次数:
167
二分查找算法(JAVA) 1.二分查找又称折半查找,它是一种效率较高的查找方法。 2.二分查找要求:(1)必须采用顺序存储结构 (2).必须按关键字大小有序排列 3.原理:将数组分为三部分,依次是中值(所谓的中值就是数组中间位置的那个值)前,中值,中值后;将要查找的值和数组的中值进行比较,若小于中值 ...
分类:
其他好文 时间:
2018-10-09 15:04:12
阅读次数:
111
Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence. For example, in the given t ...
分类:
其他好文 时间:
2018-10-08 23:17:21
阅读次数:
145
题目链接 https://leetcode.com/problems/house robber iii/description/ 题目描述 在上次打劫完一条街道之后和一圈房屋后,小偷又发现了一个新的可行窃的地区。这个地区只有一个入口,我们称之为“根”。 除了“根”之外,每栋房子有且只有一个“父“房子 ...
分类:
其他好文 时间:
2018-10-08 18:46:07
阅读次数:
408
Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence. For example, in the given t ...
分类:
其他好文 时间:
2018-10-07 20:21:23
阅读次数:
131
MySQL的复制及各种高可用架构,基本都是基于主从复制的组合。而主从复制是基于binary log的, 这里就详细介绍下基于binary log event(二进制日志事件)复制的原理。 主从复制有实现两种方法:传统复制方式(基于server_id)和GTID(全局事务ID).(MySQL5.6以后 ...
分类:
数据库 时间:
2018-10-07 16:04:12
阅读次数:
193
crash 文件里,Binary Images (app、framework) 对应的 CPU 架构,都有一个UUID 标识 在解析 crash 文件时,需要通过 UUID 匹配对应的 dSYM 文件才可正确解析,解析时,symbolicatecrash 会自动通过搜索查找 dSYM 文件 手工查找 ...
分类:
移动开发 时间:
2018-10-07 15:37:43
阅读次数:
176
Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are n ...
分类:
编程语言 时间:
2018-10-07 14:44:22
阅读次数:
133
Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST that the node's value equals the given value. Retu ...
分类:
编程语言 时间:
2018-10-06 22:08:54
阅读次数:
226