package chap10;import static
org.junit.Assert.*;import java.util.Stack;import org.junit.Test;public class
exec10_4_4 { /** * 将该树打印 * * @param tree */ ...
分类:
其他好文 时间:
2014-06-16 10:58:06
阅读次数:
183
Description :Given a singly linked list where
elements are sorted in ascending order, convert it to a height balanced
BST.分析:这道题目简单版是把一个排序好的数组转成平衡的二叉树...
分类:
其他好文 时间:
2014-06-16 10:51:54
阅读次数:
237
原题地址:https://oj.leetcode.com/problems/gray-code/题意:The
gray code is a binary numeral system where two successive values differ in only
one bit.Given a...
分类:
编程语言 时间:
2014-06-16 07:42:27
阅读次数:
242
一、树状数组树状数组是一个优美小巧的数据结构,在很多时候可以代替线段树。一句话概括就是,凡是树状数组可以解决的问题,线段树都可以解决,反过来线段树可以解决的问题,树状数组不一定能解决。树状数组英文名称为Binary
Index Tree,直译过来就是二进制索引树,我觉得二进制索引树更能说明其本质。树...
分类:
其他好文 时间:
2014-06-16 07:24:03
阅读次数:
190
Given an array where elements are sorted in
ascending order, convert it to a height balanced BST.递归,二分法。 1 /** 2 *
Definition for binary tree 3 * st.....
分类:
其他好文 时间:
2014-06-16 00:33:31
阅读次数:
252
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-06-12 08:10:28
阅读次数:
194
堆(heap) 亦被称为:优先队列(priority
queue),是计算机科学中一类特殊的数据结构的统称。堆通常是一个可以被看做一棵树的数组对象。在队列中,调度程序反复提取队列中第一个作业并运行,因而实际情况中某些时间较短的任务将等待很长时间才能结束,或者某些不短小,但具有重要性的作业,同样应当....
分类:
其他好文 时间:
2014-06-12 06:08:10
阅读次数:
465