/** * ID: 61 * Name: Rotate List * Data Structure: Linked List * Time Complexity: * Space Complexity: * Tag: LinkList * Difficult: Medium * Probl...
分类:
其他好文 时间:
2015-04-12 06:40:01
阅读次数:
177
Description: Given two sorted integer arrays A and B, merge B into A as one sorted array. Note: You may assume that A has enough space (siz...
分类:
其他好文 时间:
2015-04-11 23:50:26
阅读次数:
137
Sort a linked list in O(n log n) time using constant space complexity.这道题属于人生中第一次对链表进行操作,首先,不同于C++中的struct,java中可以用一个类来定义一个数据结构。这道题一看没有任何思路,就看别人的代码,发现...
分类:
其他好文 时间:
2015-04-11 22:23:26
阅读次数:
136
Determine whether an integer is a palindrome. Do this without extra space.看到题目第一想法是将数字倒过来相减,看是否为0,但是会超时。原因是大部分可能并不是,所以循环中间就退出循环了。目前这个程序是按最左位与最右位逐次比较。代...
分类:
其他好文 时间:
2015-04-11 20:39:13
阅读次数:
115
题目描述Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with...
分类:
其他好文 时间:
2015-04-11 18:02:04
阅读次数:
100
Determine whether an integer is a palindrome. Do this without extra space.
click to show spoilers.
Some hints:
Could negative integers be palindromes? (ie, -1)
If you are thinking of convertin...
分类:
其他好文 时间:
2015-04-11 18:02:02
阅读次数:
123
转自:http://m.oschina.net/blog/277224# 解决出现此情况是因为你的boot分区是单独分区的,像我只给了100M,以前装ubuntu时没有出现,所以当出现这个提示时,很纳闷,发现了答案.为什么boot分区会满?主要是存放了一些老的linux image镜像文件.SO,我...
分类:
其他好文 时间:
2015-04-11 16:07:47
阅读次数:
130
1 /** 2 * ID: 19 3 * Name: Remove Nth Node From End of List 4 * Data Structure: Linked List 5 * Time Complexity: 6 * Space Complexity: ...
分类:
其他好文 时间:
2015-04-11 16:06:16
阅读次数:
139
题目:
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.
For example, given
s = "leetcode",
dict...
分类:
其他好文 时间:
2015-04-11 11:48:32
阅读次数:
143