Determine whether an integer is a palindrome. Do this without extra space.
判断一个int值是否为回文数。
本题有几点需要注意:
(1)不能用额外存储空间,也就是说只能用常数空间解决;诸如将int转换为string再去比较字符是不可行的;
(2)判断回文数的方法有两个:从中间开始向两头判断、从两头向中间判断;后者更简...
分类:
其他好文 时间:
2014-07-19 23:22:39
阅读次数:
345
【C# Equals】1、Object.Equals() The type of comparison between the current instance and theobjparameter depends on whether the current instance is a ref....
分类:
其他好文 时间:
2014-07-19 15:04:20
阅读次数:
258
Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers b...
分类:
其他好文 时间:
2014-07-18 15:17:26
阅读次数:
201
题目如下:
Problem I
23 Out of 5
Input: standard input
Output: standardoutput
Time Limit: 1 second
Memory Limit: 32 MB
Your task is to writea program that can decide whether you can find an arithm...
分类:
其他好文 时间:
2014-07-16 17:16:32
阅读次数:
203
There are proven psychological principles to user interfaces that work.Whether you have a team of design experts or are just building with programmer art, you can use these principles to make your gam...
分类:
其他好文 时间:
2014-07-16 16:33:00
阅读次数:
243
If we execute these assignment statements: We know that a and b both refer to a string, but we don’t know whether they refer to the same str...
分类:
其他好文 时间:
2014-07-15 23:20:09
阅读次数:
208
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree is symmetric:...
分类:
其他好文 时间:
2014-07-13 17:13:49
阅读次数:
213
题目描述:
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.
For example,
Given:
s1 = "aabcc",
s2 = "dbbca",
When s3 = "aadbbcbcac", return
true.
When s3 = "aad...
分类:
其他好文 时间:
2014-07-10 21:15:16
阅读次数:
166
TaskdescriptionAnon-emptyzero-indexedarrayAconsistingofNintegersisgiven.Apermutationisasequencecontainingeachelementfrom1toNonce,andonlyonce.Forexample,arrayAsuchthat:A[0]=4A[1]=1A[2]=3A[3]=2isapermutation,butarrayAsuchthat:A[0]=4A[1]=1A[2]=3isnotapermutati..
分类:
其他好文 时间:
2014-07-08 12:28:44
阅读次数:
201