Given an array where elements are sorted in ascending order, convert it to a height balanced BST.说明:平衡二叉搜索树,即任何结点的左子树和右子树高度最多相差1的二叉搜索树。二叉搜索树:二叉查找树(Bin... Read More
posted @ 2014-06-18 23:13 Xylophone Views(176) Comments(0) Diggs(0)
Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't mat... Read More
posted @ 2014-06-18 21:35 Xylophone Views(120) Comments(0) Diggs(0)
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or... Read More
posted @ 2014-06-18 21:25 Xylophone Views(123) Comments(0) Diggs(0)
Given a sorted linked list, delete all duplicates such that each element appear only once.For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3... Read More
posted @ 2014-06-18 21:15 Xylophone Views(157) Comments(0) Diggs(0)
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists./** * Def... Read More
posted @ 2014-06-18 20:56 Xylophone Views(116) Comments(0) Diggs(0)