Determine whether an integer is a palindrome. Do this without extra space.Notes:1) Negative number is notpalindrome.2) Compare from head to tail, cons...
分类:
其他好文 时间:
2014-11-08 16:43:57
阅读次数:
124
Problem DescriptionSmall W gets two files. There are n integers in each file. Small W wants to know whether these two files are same. So he invites yo...
分类:
其他好文 时间:
2014-11-06 23:22:14
阅读次数:
309
题目描述:
Determine whether an integer is a palindrome. Do this without extra space.
代码:
bool Solution::isPalindrome(int x)
{
int a = x;
int b = 0;
while(a > 0)
{
b = b * ...
分类:
其他好文 时间:
2014-11-05 21:35:26
阅读次数:
167
题目描述:
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree is symmetric:
1
/ 2 2
/ \ / 3 4 4 3
...
分类:
其他好文 时间:
2014-11-04 17:24:06
阅读次数:
132
http://jc-dreaming.iteye.com/blog/754690/***判断对象是否为空*Check whether string s is empty.*/function isEmpty(s){return ((s == undefined || s == null || s =...
分类:
Web程序 时间:
2014-11-04 12:33:48
阅读次数:
150
Determine whether an integer is a palindrome. Do this without extra space.要求是不能使用额外的空间,言下之意就是不能先转化成字符串来进行处理,所以得想另外一种办法。额外考虑:负数属于回文数字?思路:直接来截取最低位和最高位来进...
分类:
其他好文 时间:
2014-11-03 22:26:57
阅读次数:
246
算法能力一直不好,决定利用晚上和假期时间多做点算法题,动动手,提高自己。大家看到我的水平低还望莫要嘲笑,嘻嘻。 这一题呢是LeetCode上的对称树问题, Given a binary tree, check whether it is a mirror of itself (ie, sym...
分类:
其他好文 时间:
2014-11-02 22:29:08
阅读次数:
231
Android - Layout clipChildren属性本文地址: http://blog.csdn.net/caroline_wendyandroid:clipChildren: Defines whether a child is limited to draw inside of its bounds or not.子控件是否它的范围之内,默认是true,如果设为false,则子控件可...
分类:
移动开发 时间:
2014-10-30 21:04:24
阅读次数:
170
??
The choice of whether to design your functionality as an interface or an abstract class can sometimes be a difficult one. An
abstract class is a class that cannot be instantiated, but must be inh...
Determine whether an integer is a palindrome. Do this without extra space.这题貌似解法挺多,直接用简单的把数倒置,没有考虑数据溢出的问题,如需解决可以把转置数设为long long即可。另外方法可以用到前后匹配、递归比较等。 ...
分类:
其他好文 时间:
2014-10-29 12:30:15
阅读次数:
115