题目:Recover Binary Search TreeTwo elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A ...
分类:
其他好文 时间:
2014-06-28 10:26:38
阅读次数:
253
Impact crusher is a new crushing equipment taking advantages of impact effect to crush materials, which has such features as big reduction ratio, high...
分类:
其他好文 时间:
2014-06-25 23:12:07
阅读次数:
258
CentOS安装Puppet
环境介绍:centos6.4x64 采用CentOS-6.4-x86_64-minimal.iso最小化安装
puppet版本3.6.2,ruby1.8.7,facter1.7.1
安装过程:1,关闭selinux
2,添加puppet安装源 rpm -ivh
htt...
分类:
其他好文 时间:
2014-06-24 22:36:51
阅读次数:
256
题目:给你一个数和一棵树,问时钟是否存在根到叶子的路径使得路径上的数字和与已知数相等。
分析:递归、栈。因为除了最外边的树外,其他都有两颗子树,直接递归求解即可。
如果存在一棵子树成立,即返回成立。注意空叶子为空不是0,它的上级加点返回结果。
说明:注意数据中可能有负数。(POJ1145)
#include
#include
#include
using n...
分类:
其他好文 时间:
2014-06-24 18:32:10
阅读次数:
187
一改时间以后WA了,我就知道这题是考字典树,可惜代码怎么也不会敲了,郁闷。#include #include #include typedef struct Node{ int flag;struct Node *next[26];}Node,*Tree;char a[200010][6];int ...
分类:
其他好文 时间:
2014-06-24 14:31:01
阅读次数:
161
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(...
分类:
其他好文 时间:
2014-06-24 13:40:33
阅读次数:
214
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(...
分类:
其他好文 时间:
2014-06-24 13:32:40
阅读次数:
157
二叉查找树(Binary Search Tree),也称有序二叉树(ordered binary tree),排序二叉树(sorted binary tree),是指一棵空树或者具有下列性质的二叉树:若任意节点的左子树不空,则左子树上所有结点的值均小于它的根结点的值;任意节点的右子树不空,则右子树上...
分类:
其他好文 时间:
2014-06-24 12:21:17
阅读次数:
257
说明 :vim的插件NERDTree用于使得vim窗口分左右窗口显示的用法说明。其中,左侧为目录的树形界面,简称为NERDTree界面,右则为vim界面。 一、配置步骤 下载地址: http://www.vim.org/scripts/script.php?script_id=1658 或者 htt...
分类:
其他好文 时间:
2014-06-22 11:53:04
阅读次数:
258
题目:
Given a binary tree containing digits from 0-9 only, each root-to-leaf
path could represent a number.
An example is the root-to-leaf path 1->2->3 which represents the number 123.
Find...
分类:
其他好文 时间:
2014-06-22 08:30:24
阅读次数:
236