Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have t...
分类:
其他好文 时间:
2014-08-18 12:20:34
阅读次数:
148
int.TryParse,Convert.ToInt32,(int)这几种类型在将浮点类型转换整数时是有差别Convert.ToInt32则会进行四舍五入int.TryParse只能转换整数,即浮点类型全部会返回0(int)不会进行四舍五入,只取整数部分,小数点部分完全舍弃usingSystem;p...
分类:
其他好文 时间:
2014-08-18 12:08:54
阅读次数:
414
class Solution {public: string convert(string s, int nRows) { int len = s.length(); if (len cols; int si = 0; int ri =...
分类:
其他好文 时间:
2014-08-17 21:21:32
阅读次数:
218
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.思路:取数组的中点为树的根,前半部分为左子树,后半部分为右子树。 1 class Solution { 2...
分类:
其他好文 时间:
2014-08-17 13:02:12
阅读次数:
210
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.思路:使用两个指针分别以1、2的速度遍历链表,以定位出链表的中点,进而将链表分割成...
分类:
其他好文 时间:
2014-08-17 02:21:36
阅读次数:
246
一、类型转换1.强制转换(显示转换)A.变量=(需要转换的类型)变量--仅适合于同一类型内转换.例:float a; double b=3.14; a=(float)b;B.变量=Convert.To数据类型 (变量)--值类型转换.PS:TO数据类型必须用".net数据类型"来表示.例:float...
分类:
其他好文 时间:
2014-08-16 13:47:10
阅读次数:
234
Convert Sorted List to Binary Search TreeGiven a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST....
分类:
其他好文 时间:
2014-08-16 12:19:20
阅读次数:
227
首先是加密byte[] bytes = Encoding.Default.GetBytes("要转换的字符");string str = Convert.ToBase64String(bytes);然后是解密byte[] outputb = Convert.FromBase64String(str)...
分类:
其他好文 时间:
2014-08-16 10:58:20
阅读次数:
275
CONVERT 函数将某种数据类型的表达式显式转换为另一种数据类型。SQL Server中 将日期格式化.SQL Server 支持使用科威特算法的阿拉伯样式中的数据格式。在表中,左侧的两列表示将 datetime 或 smalldatetime 转换为字符数据的 style 值。给 style 值...
分类:
数据库 时间:
2014-08-16 09:40:00
阅读次数:
184
一、类型转换1.强制转换(显示转换)A.变量=(需要转换的类型)变量--仅适合于同一类型内转换.例:float a; double b=3.14;a=(float)b;B.变量=Convert.To数据类型 (变量)--值类型转换.PS:TO数据类型必须用".net数据类型"来表示.例:float ...
分类:
其他好文 时间:
2014-08-16 09:38:10
阅读次数:
169