Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
class Solution {
public:
vector Num;
TreeNode *sortedArrayToBST(vector &num) {
if (num.size() == 0) r...
分类:
其他好文 时间:
2015-03-21 11:24:00
阅读次数:
169
UVA - 10474
Where is the Marble?
Time Limit: 3000MS
Memory Limit: Unknown
64bit IO Format: %lld & %llu
Submit Status
Description
Raju and Meena love to play ...
分类:
编程语言 时间:
2015-03-21 09:53:59
阅读次数:
198
Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ...
分类:
其他好文 时间:
2015-03-21 06:17:48
阅读次数:
108
Given a list, rotate the list to the right by k places, where k is non-negative.
For example:
Given 1->2->3->4->5->NULL and k = 2,
return 4->5->1->2->3->NULL.
这道题是要求将单链表循环右移k次,每次...
分类:
其他好文 时间:
2015-03-20 23:53:07
阅读次数:
287
https://leetcode.com/problems/trapping-rain-water/Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute ...
分类:
移动开发 时间:
2015-03-20 23:31:14
阅读次数:
204
/// /// 序列化 /// /// /// public static byte[] SerializeObject(T obj) where T : class { Syste...
分类:
Web程序 时间:
2015-03-20 18:14:18
阅读次数:
148
CREATE TRIGGER TR_BORROW ON BORROWAFTER INSERTASIF((SELECT I.BNO FROM INSERTED I) in(SELECT BNO FROM BOOKS WHERE BNAME='b002'))BEGININSERT BORROW_SAV....
分类:
数据库 时间:
2015-03-20 18:01:57
阅读次数:
303
联接条件可在FROM或WHERE子句中指定,建议在FROM子句中指定联接条件。WHERE和HAVING子句也可以包含搜索条件,以进一步筛选联接条件所选的行。?? ? 联接可分为以下几类: ? 1、内联接(典型的联接运算,使用像...
分类:
数据库 时间:
2015-03-20 16:36:13
阅读次数:
226
错误的意思说,不能先select出同一表中的某些值,再update这个表(在同一语句中)。 例如下面这个sql: delete from tbl where id in( select max(id) from tbl a where EXISTS ( select 1 from tbl ...
分类:
数据库 时间:
2015-03-20 16:20:51
阅读次数:
162
题目:rotate list
解法1:
/**LeetCode Rotate List:Given a list, rotate the list to the right by k places, where k is non-negative.
* 题目:循环移动链表,等价于将链表从右边数的k个节点移动到表的前方
* 思路:移动倒是简单,重点是要找到链表倒数的k个数,就等价于找到倒数第...
分类:
其他好文 时间:
2015-03-20 14:28:55
阅读次数:
134