题目: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 onl...
分类:
其他好文 时间:
2014-05-23 12:20:50
阅读次数:
407
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 le...
分类:
其他好文 时间:
2014-05-23 11:54:10
阅读次数:
317
题目: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 ...
分类:
其他好文 时间:
2014-05-23 11:31:51
阅读次数:
299
幻灯片播放、图片轮播————非常优秀的swiper插件http://www.idangero.us/sliders/swiper/index.php
插件主页http://www.idangero.us/sliders/swiper/api.php 插件APIhttp://www.idang...
分类:
其他好文 时间:
2014-05-23 11:09:08
阅读次数:
748
uva 548 Tree
题目大意:
给定一个二叉树的中序和后序遍历,求二叉树到每个叶节点的路径和最小的那个叶节点的值。
解题思路:
先建树,后dfs,建树也就是后序的最后一个就是二叉树的当前节点的值,再在中序中找到这个值,那么左边就是左子树,右边就是又子树,再从后序中找出相应的左右子树的后序,然后划分为子问题递归求解。...
分类:
其他好文 时间:
2014-05-23 08:10:59
阅读次数:
255
操作系统:winxpVC环境:VC6.0必需文件:Berkeley
DB安装文件(db-.msi)下载地址http://www.oracle.com/technology/software/products/berkeley-db/index.html步骤:1、运行db-4.7.25.msi,安装B...
分类:
数据库 时间:
2014-05-20 13:27:15
阅读次数:
508
戳我去解题Given an array where elements are sorted in
ascending order, convert it to a height balanced
BST.分析:因为BST中序序列是升序的,所以中序遍历序列最中间的元素一定是根节点,然后左右递归构建二叉...
分类:
其他好文 时间:
2014-05-20 11:38:16
阅读次数:
233
戳我去解题Given two binary strings, return their sum
(also a binary string).For example,a ="11"b
="1"Return"100".分析:高精度加法,只是将10进制的高精度加法 换成了 2进制的高精度加法首先将 两个...
分类:
其他好文 时间:
2014-05-20 11:21:52
阅读次数:
224
实验1 实验目的:使用opencv操作摄像头拍摄一张图片 函数: 1 CvCapture*
cvCreateCameraCapture( int index ); 2 IplImage* cvQueryFrame( CvCapture* capture
); 实验代码: 1 #in...
分类:
其他好文 时间:
2014-05-20 11:12:01
阅读次数:
248
戳我去解题Given two binary trees, write a function to
check if they are equal or not.Two binary trees are considered equal if they are
structurally identic...
分类:
其他好文 时间:
2014-05-20 10:09:37
阅读次数:
201