Given an array where elements are sorted in ascending order, convert it to a height balanced BST.有序数组变二叉平衡搜索树,不难,递归就行。每次先序建立根节点(取最中间的数),然后用子区间划分左右子树。一...
分类:
其他好文 时间:
2014-11-27 23:20:29
阅读次数:
269
判断是否为中文 public string IsChina(string CString) { string ResultValue = string.Empty; for (int i = 0; i < CString.Length; i++) { if (Convert.ToInt32(Conv...
分类:
其他好文 时间:
2014-11-27 12:01:04
阅读次数:
110
DECLARE @dt datetime
SET @dt=GETDATE()
DECLARE @number int
SET @number=3
--1.指定日期该年的第一天或最后一天
--A. 年的第一天
SELECT CONVERT(char(5),@dt,120)+ '1-1 '
--B. 年的最后一天
SELECT CONVERT(char(5)...
分类:
数据库 时间:
2014-11-27 10:51:36
阅读次数:
293
Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below a...
分类:
其他好文 时间:
2014-11-27 08:00:27
阅读次数:
319
mb_convert_encoding — 转换字符的编码 string?mb_convert_encoding?(?string?$str?,?string?$to_encoding?[,?mixed?$from_encoding?= mb_internal_encoding()?] ) /*?将?EUC-JP?转换成?UTF-7?...
分类:
Web程序 时间:
2014-11-27 01:39:59
阅读次数:
213
Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999. 1 public class Solution { 2 public int ...
分类:
其他好文 时间:
2014-11-27 01:28:59
阅读次数:
203
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.public class Solution { public String int...
分类:
其他好文 时间:
2014-11-26 23:57:48
阅读次数:
330
给出一个已排序的数组,将其转化为二叉查找树(BST)。思路:取数组中间元素为根结点的value,则数组左侧、右侧分别为BST的左子树、右子树。递归可求解。代码如下: 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * ...
分类:
其他好文 时间:
2014-11-26 18:13:30
阅读次数:
206
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.之前那篇文章写的是罗马数字转化成整数(http://www.cnblogs.com/gr...
分类:
其他好文 时间:
2014-11-26 16:20:50
阅读次数:
244
The conclusion is:NEON intrinsics support converting a float data type to int32 regarding a Q value. The reverse is also supported.Neon intrinsics alr...
分类:
其他好文 时间:
2014-11-26 14:10:55
阅读次数:
534