Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Note:A solution using O(n) space i ...
分类:
编程语言 时间:
2016-10-26 00:04:21
阅读次数:
269
Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only ...
分类:
编程语言 时间:
2016-10-25 19:35:23
阅读次数:
236
There are a lot of trees in an area. A peasant wants to buy a rope to surround all these trees. So at first he must know the minimal required length o ...
分类:
其他好文 时间:
2016-10-25 16:20:33
阅读次数:
206
摘要 上一篇: MySQL Replication 基础 一、主主复制 二、半同步复制 三、复制过滤器 四、总结 五、切分 待续 一、主主复制 MySQL的主主复制通过互为主从来实现,此时负载均衡调度器较为容易实现,但是由于多台服务器都为Master,但是存在着严重的问题,需要慎重使用: 1. 数据 ...
分类:
数据库 时间:
2016-10-25 14:37:37
阅读次数:
273
2.设置超时时间 如果代理需要账户和密码,则需这样: proxies = { "http": "http://user:pass@10.10.1.10:3128/", } 还可以显式地设置文件名: >>> url = 'http://httpbin.org/post' >>> files = {'f ...
分类:
编程语言 时间:
2016-10-25 14:06:46
阅读次数:
174
这篇文章用来回顾二叉搜索数的以下操作: 遍历 前序遍历 中序遍历 后序遍历 层序遍历 查找 查找最大值 查找最小值 查找指定值 前序遍历 中序遍历 后序遍历 层序遍历 查找最大值 查找最小值 查找指定值 获取指定属性 获取总节点/叶节点数量 获取二叉树的高度(根的高度为1) 行为操作 插入 删除 获 ...
分类:
其他好文 时间:
2016-10-25 02:10:30
阅读次数:
266
1.前言: 动态查找树主要有:二叉查找树(Binary Search Tree),平衡二叉查找树(Balanced Binary Search Tree),红黑树(Red-Black Tree ),B-tree/B+-tree/ B*-tree (B~Tree)。前三者是典型的二叉查找树结构,其查找 ...
分类:
其他好文 时间:
2016-10-24 23:53:53
阅读次数:
499
# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# self.right = Noneclass Solution ...
分类:
编程语言 时间:
2016-10-24 22:59:37
阅读次数:
179
前言: 这些日子开始准备搞OFDM之类的,未动先行matlab仿真,这里我会慢慢更新,基本上是自己学习感悟吧<未完待续> 一、PRBS PRBS 是 Pseudo Random Binary Sequence 的缩写,即“伪随机二进制序列”的意思。 PRBS 码具有“随机”特性,是因为在 PRBS ...
分类:
其他好文 时间:
2016-10-24 22:55:25
阅读次数:
225
Problem: Invert a binary tree. to Analysis: 1、helper function + recursion 一开始我用调用子函数,在子函数中递归的方式实现: 1 /** 2 * Definition for a binary tree node. 3 * st ...
分类:
其他好文 时间:
2016-10-24 14:08:26
阅读次数:
252