原题地址:https://oj.leetcode.com/problems/longest-substring-without-repeating-characters/题意:Given a string, find the length of the longest substring witho...
分类:
编程语言 时间:
2014-06-15 19:51:00
阅读次数:
254
Linked List Cycle:Given a linked list, determine if
it has a cycle in it.Follow up:Can you solve it without using extra
space?解题分析:大致思想就是设置两个指针,一个指针每次...
分类:
其他好文 时间:
2014-06-13 14:41:54
阅读次数:
238
1 public class Solution { 2 public int
lengthOfLongestSubstring(String s) { 3 int length = s.length(); 4 if (length ==
0) return ...
分类:
其他好文 时间:
2014-06-13 08:31:32
阅读次数:
214
原题地址:https://oj.leetcode.com/problems/divide-two-integers/题意:Divide
two integers without using multiplication, division and mod
operator.解题思路:不许用乘、除和求...
分类:
编程语言 时间:
2014-06-10 21:43:00
阅读次数:
267
原题地址:https://oj.leetcode.com/problems/palindrome-number/题意:Determine
whether an integer is a palindrome. Do this without extra space.click to show
spo...
分类:
编程语言 时间:
2014-06-10 16:06:52
阅读次数:
286
链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=151For each list
of words, output a line with each word reversed without changing the or...
分类:
其他好文 时间:
2014-06-10 00:14:19
阅读次数:
300
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without
repeating letters for "abcabcbb" is "abc", which the length is 3. Fo...
分类:
其他好文 时间:
2014-06-08 16:27:47
阅读次数:
231
题目:
Determine whether an integer is a palindrome. Do this without extra space.
解题思路:
判断一个int型整数是不是回文数字,这个题也不难,依次取得数字最高位和最低位进行比较,就可以判断是不是回文数字。需要注意的是负数不是回文数字。
代码实现:...
分类:
其他好文 时间:
2014-06-08 15:35:48
阅读次数:
375
题目
Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
Note:
A solution using O(n)
space is pretty straight forward. Cou...
分类:
其他好文 时间:
2014-06-08 15:32:45
阅读次数:
245
题目:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For "bbbbb" the longest substring is "b", with the length...
分类:
其他好文 时间:
2014-06-08 03:06:52
阅读次数:
221