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
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
1,在控制器中实现去除html标签的静态方法//去除html标签 public static string ReplaceHtmlMark(object Contents) { string HtmlString = Convert.ToString...
分类:
Web程序 时间:
2014-06-15 21:32:38
阅读次数:
224
SelectCONVERT(varchar(100),GETDATE(),0):0516200610:57AMSelectCONVERT(varchar(100),GETDATE(),1):05/16/06SelectCONVERT(varchar(100),GETDATE(),2):06.05.1...
分类:
其他好文 时间:
2014-06-10 20:37:32
阅读次数:
311
原题地址:https://oj.leetcode.com/problems/roman-to-integer/题意:Given
a roman numeral, convert it to an integer.Input is guaranteed to be within the
range f...
分类:
编程语言 时间:
2014-06-10 19:34:10
阅读次数:
255
原题地址:https://oj.leetcode.com/problems/integer-to-roman/题意:Given
an integer, convert it to a roman numeral.Input is guaranteed to be within the
range f...
分类:
编程语言 时间:
2014-06-10 17:06:11
阅读次数:
261
1.取月初的时间 --getdate() :2012/05/08 19:29:00 select
convert(varchar,dateadd(day,-day(getdate())+1,getdate()),111) --结果:2012/05/08
2.取月末时间 select convert....
分类:
数据库 时间:
2014-06-10 13:12:24
阅读次数:
418
问题:
给定一个有序链表,生成对应的平衡二叉搜索树。
分析
见Convert
Sorted Array to Binary Search Tree
实现:
TreeNode *buildTree(ListNode* head, ListNode *end){
if(head == NULL || head == end)
return NULL;
...
分类:
其他好文 时间:
2014-06-10 07:17:29
阅读次数:
264
DateTime dt = DateTime.Now; //当前时间DateTime
startWeek = dt.AddDays(1 - Convert.ToInt32(dt.DayOfWeek.ToString("d")));
//本周周一DateTime endWeek = startWeek...
分类:
其他好文 时间:
2014-06-09 18:16:26
阅读次数:
231