Merge Sorted ArrayGiven two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that i...
分类:
其他好文 时间:
2014-12-21 22:02:28
阅读次数:
189
题目:
Determine whether an integer is a palindrome. Do this without extra space.
分析:
该题目来源于leetcode。回文串是一个正读和反读都一样的字符串,比如“level”或者“noon”等等就是回文串。当然整数形式的回文串也是类似的。但负数不是回文串。两种思路:
按定义来,依次比较串的首尾,直到中...
分类:
其他好文 时间:
2014-12-21 20:43:45
阅读次数:
174
1、题目Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 2...
分类:
其他好文 时间:
2014-12-21 19:18:21
阅读次数:
180
这两天在看周志明的《深入理解java虚拟机》,受益颇多,根据书中的启示,对java中‘==’和‘equals()’方法的区别做了一些探索:1、为什么值为3两个Integer对象使用==比较时返回true,而同为321的Integer对象在==时却为false?2、为什么value相同的Long和Integer对象使用==比较返回了false?...
分类:
编程语言 时间:
2014-12-21 18:02:09
阅读次数:
224
Integer to RomanGiven an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.逐区间做处理。解法一:非递归class Solution...
分类:
其他好文 时间:
2014-12-21 13:58:22
阅读次数:
136
Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.从左到右遍历每个字符,并记录上个字符来处理双字符情况即可...
分类:
其他好文 时间:
2014-12-21 13:48:45
阅读次数:
191
Excel Sheet Column TitleGiven a non-zero positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A ...
分类:
其他好文 时间:
2014-12-21 00:44:20
阅读次数:
284
Excel Sheet Column TitleGiven a non-zero positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A ...
分类:
其他好文 时间:
2014-12-20 22:07:17
阅读次数:
233
Excel Sheet Column TitleGiven a non-zero positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A ...
分类:
其他好文 时间:
2014-12-20 19:38:27
阅读次数:
242