- 博客(8)
- 收藏
- 关注
原创 Leetcode : Palindrome Number
Palindrome NumberJan 4 '12 Determine whether an integer is a palindrome. Do this without extra space. 思路: 1)这题其实可以参照Leetcode : Reverse Integer(http://blog.youkuaiyun.com/errant_xia/article/
2013-03-14 22:18:44
789
原创 Leetcode : String to Integer (atoi)
String to Integer (atoi)Dec 27 '11 Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and a
2013-03-07 22:11:41
797
原创 [面试题] 判断一个单链表是否有环
题目: 已知一个单向链表的头指针是 Node* pHead,如何判断该单项链表是否有环路! Note 1: 看了很多文章中都是直接说定义两个指针,一个每次走一步(PA),一个每次走两步(PB),看最终是否相遇(有环),或者有一个指针指向NULL(无环)。看完之后有点懵,不知道为什么这样就能解决问题。无奈之下只要先证明方法的可行性了。 证明:(反证法) 如果链表中没有环,则
2013-03-07 00:18:00
1076
原创 Leetcode : Reverse Integer
Reverse IntegerDec 26 '11 Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 Note : 这道题比较简单,很多计算机语言的初级教程的习题中都会遇到,但需要对一种特殊情况考虑到(x = 0),也就是当编程时
2013-03-05 22:36:20
807
原创 Leetcode : ZigZag Conversion
ZigZag ConversionDec 6 '11 The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better leg
2013-03-05 22:20:20
2270
1
原创 Leetcode : Longest Palindromic Substring
Longest Palindromic SubstringNov 11 '11 Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest
2013-03-04 23:54:11
558
原创 Leetcode : Add Two Numbers
Add Two NumbersNov 1 '11 You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two
2013-02-28 00:08:09
565
原创 Leetcode : Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example, Given [100, 4, 200, 1, 3, 2], The longest consecutive elements sequence is [1,
2013-02-28 00:00:19
537
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅