原题:
An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalanci...
分类:
其他好文 时间:
2014-12-29 18:24:07
阅读次数:
154
Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 这道题挺简单的,不多说了,代码奉上 class Solution {
publ...
分类:
移动开发 时间:
2014-12-29 15:00:32
阅读次数:
209
Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree{3,9,2...
分类:
其他好文 时间:
2014-12-29 13:43:28
阅读次数:
132
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-12-29 13:42:53
阅读次数:
158
Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For exa...
分类:
其他好文 时间:
2014-12-29 13:36:27
阅读次数:
109
Binary Tree Upside DownGiven a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent nod...
分类:
其他好文 时间:
2014-12-29 13:30:29
阅读次数:
105
【题目】
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
【分析】
无
【代码】
在下面超时的代码上进行改进:把链表先转换为vector再进行操作。
[LeetCode]108.Convert Sorted Ar...
分类:
其他好文 时间:
2014-12-29 12:14:29
阅读次数:
124
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/42218839
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 of the two subtrees o...
分类:
其他好文 时间:
2014-12-29 09:03:54
阅读次数:
134
题目:
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 and the nodes have the same value.
解决方...
分类:
其他好文 时间:
2014-12-28 23:47:47
阅读次数:
394
pager jar网址:http://java2s.com/Code/Jar/t/Downloadtaglibspagejar.htmpackage com.binary.entity;import java.util.List;public class PageModel { private lo...
分类:
其他好文 时间:
2014-12-28 22:03:37
阅读次数:
220