问题描述在一个字符串中找到第一个只出现一次的字符。如输入字符串"abbc",应该输出字符'a'。程序public class FirstCharacter { // Time/Space: O(n) public char findFirstAppearChar(String s) { if (s....
分类:
其他好文 时间:
2015-07-03 11:51:56
阅读次数:
122
#from 《Python 2.7.9 documentation》Use 4-space indentation, and no tabs.#使用4空格缩进,不要使用tab缩进Wrap lines so that they don’t exceed 79 characters.拆行确保每行不超过7...
分类:
编程语言 时间:
2015-07-02 22:16:39
阅读次数:
154
https://leetcode.com/problems/sort-list/Sort ListSort a linked list inO(nlogn) time using constant space complexity.来自http://www.cnblogs.com/zuoyuan/p...
分类:
其他好文 时间:
2015-07-02 22:15:21
阅读次数:
149
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 = [“leet”, “co...
分类:
其他好文 时间:
2015-07-02 01:08:01
阅读次数:
126
题目:Given an integer array of size n, find all elements that appear more than ? n/3 ? times. The algorithm should run in linear time and in O(1) space.
求出现次数大于三分之一数组的长度,所以最多就只有2个这样的元素,题目要求线性时间复杂度和常数的空...
分类:
编程语言 时间:
2015-07-01 23:47:42
阅读次数:
424
有的项目引用了太多的jar包,或者反射生成了太多的类,异或有太多的常量池,就有可能会报java.lang.OutOfMemoryError: PermGen space的错误, 我们知道可以通过jvm参数 -XX:MaxPermSize=256m来配置这部分堆内存的大小。在eclipse中如何配置t...
分类:
编程语言 时间:
2015-07-01 22:05:07
阅读次数:
128
Given an integer array of sizen, find all elements that appear more than? n/3 ?times. The algorithm should run in linear time and in O(1) space.思路: 【....
分类:
其他好文 时间:
2015-07-01 22:04:10
阅读次数:
129
#vim/etc/mail.rc在文档最后添加以下两行setfrom=***@163.comsmtp=smtp.163.comsetsmtp-auth-user=***@163.comsmtp-auth-password=***smtp-auth=login下面一行命令式测试添加后能不能发送邮件给***@qq.com#cat/etc/passwd|mail-s"systemstatue"173056183@qq.cm#vim/root/space...
分类:
系统相关 时间:
2015-07-01 18:39:59
阅读次数:
262
9 Palindrome Number链接:https://leetcode.com/problems/palindrome-number/
问题描述:
Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:
Could negat...
分类:
其他好文 时间:
2015-07-01 18:26:10
阅读次数:
111
Determine whether an integer is a palindrome. Do this without extra space.
题目:判断int数据是否为回文数
注意:负数不是回文数,0是最小的回文数
思路:此题和前面一道 求int数的反序差不多http://blog.csdn.net/xiabodan/article/details/46674133...
分类:
其他好文 时间:
2015-07-01 18:22:52
阅读次数:
154