Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].Not...
分类:
其他好文 时间:
2014-11-07 09:43:14
阅读次数:
211
Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root ...
分类:
其他好文 时间:
2014-11-07 00:58:54
阅读次数:
259
InsertSort中有关键的一步是把当前元素A[i]插入到已经排好序的A[1,i-1]的合适的位置上,在原始的InsertSort算法中,采用的是从后往前一步一步查找的方法,习题2.3-6要求利用习题2.3-5中的binary search的方法,加速这个插入的过程。把binary search ...
分类:
编程语言 时间:
2014-11-06 21:52:18
阅读次数:
220
地球人都知道“二分查找”,方法也非常简单,但是你能不能在10分钟内写出一个没有bug的程序呢?知易行难,自己动手写一下试一试吧。public class BinarySearch { public static int search(int [] A,int target,int a, int...
分类:
编程语言 时间:
2014-11-06 21:52:14
阅读次数:
180
int binary_search(int* A, int value, int p, int r);int main(int argc, char *argv[]){ int A[] = {1, 2, 3, 4, 4, 4, 4, 4, 4, 5}; int index...
分类:
其他好文 时间:
2014-11-06 21:26:23
阅读次数:
220
microblog实例源代码下载地址:https://github.com/scoolwang/mblog/tree/master项目依赖包的版本参考文章:http://blog.csdn.net/shi0090/article/details/22818121
分类:
Web程序 时间:
2014-11-06 20:00:42
阅读次数:
201
今天看Python CookBook中关于“求list中最大(最小)的N个元素”的内容,介绍了直接使用python的heapq模块的nlargest和nsmallest函数的解决方式,记得学习数据结构的时候有个堆排序算法,所以顺便研究了一下“堆”结构(这里特指二叉堆)。概念所谓二叉堆(binary ...
分类:
编程语言 时间:
2014-11-06 19:40:59
阅读次数:
470
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth...
分类:
其他好文 时间:
2014-11-06 19:27:14
阅读次数:
227
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 identical an...
分类:
其他好文 时间:
2014-11-06 19:07:13
阅读次数:
205
前台树结构根据个人的权限登录变化 所有我查询要根据 树的ID 查询下面所有的子节点 以及本节点的信息
select * from table start with id = #{id}
connect by prior id = pid
这里的id就是 父节点的ID...
分类:
数据库 时间:
2014-11-06 17:34:24
阅读次数:
204