这个题目纠结了一会儿,终于从二叉树转化到AVL了。题目如下:Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a ...
分类:
其他好文 时间:
2014-11-13 12:41:02
阅读次数:
157
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.Solution: 1 /** 2 * Definition for binary tree 3 * .....
分类:
其他好文 时间:
2014-11-09 00:58:31
阅读次数:
213
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-09 00:55:08
阅读次数:
250
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.Solution: 1 /** 2 * Definition for singl....
分类:
其他好文 时间:
2014-11-09 00:52:30
阅读次数:
316
Intergalactic MapTime Limit: 6000msMemory Limit: 262144KBThis problem will be judged onSPOJ. Original ID:IM64-bit integer IO format:%lld Java class na...
分类:
其他好文 时间:
2014-11-08 23:25:16
阅读次数:
350
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
这几天A的都是二叉树的,如果输的基本操作掌握了,用递归很好解决这些题目的。这个可能不是最好的解法,明天再去Discuss看看有没有好的解法Balanced Binary TreeGiven a binary tree, determine if it is height-balanced.For t...
分类:
其他好文 时间:
2014-11-05 22:57:24
阅读次数:
261
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 1 /** 2 * Definition for singly-linked ....
分类:
其他好文 时间:
2014-11-03 23:53:07
阅读次数:
185
POJ Balanced Lineup(RMQ_ST)...
分类:
其他好文 时间:
2014-11-03 22:30:54
阅读次数:
251