![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构与算法
DXZCZH丹心智
这个作者很懒,什么都没留下…
展开
-
LeetCode:9.Palindrome Number[Easy]
题目:Determine whether an integer is a palindrome. Do this without extra space.(确定一个整数是否是回文数.计算不可使用额外空间) 首先,Without Extra Space并不是一点额外空间都不可使用,而是指只能使用O(1)的空间。 其次,看一下题目给出的提示: 1. 负数该如何处理?通过测试,他给出的结果,负数都不原创 2017-03-02 14:56:59 · 325 阅读 · 0 评论 -
LeetCode:29.Divide Two Integers[Medium]
题目:Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT. 首先,题目要求计算两个数相除的结果 其次,不能使用乘法、除法和模运算;如果结果溢出直接返回MAX_INT。根据题目的限制,首先可能想到使用减法,循环用被除数减除数,知道小原创 2017-04-25 20:29:55 · 364 阅读 · 0 评论