欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
Sort List
Sort a linked list in O(n log n) time using constant space complexity.
// 归并排序法:在动手之前一直觉得空间复杂度为常量不太可能,因为原来使用归并时,都是 O(N)的,需要复制出相等的空间来进行赋值归并。对于链表,实际...
分类:
其他好文 时间:
2015-02-14 17:34:48
阅读次数:
166
android在使用SQLiteDatabase插入数据时,抛出如下异常:
W/CursorWindow(25503): Window is full: requested allocation 5583269 bytes, free space 2096639 bytes, window size 2097152 bytes
解决方法:数据库表字段值如果超过2M,那么就把值存在文件中,然后把文件路径存在此字段中。...
情景:
在编译Keil工程时,compile编译能够通过,但在linking过程中,出现一大串”Error: L6406W: No space in execution regions with .ANY selector match Section“的错误。
分析:
这个出现的原因是因为芯片RAM空间不足,无法执行程序。通常RAM的空间会比较小,ROM空间相对较大。
解决...
分类:
其他好文 时间:
2015-02-13 18:34:22
阅读次数:
171
判断是否数字,考虑多种情况
class Solution{
public:
bool isNumber(string s){
int i = 0;
while(s[i] == ' ') ++i;
while(s[i] == '+' || s[i] == '-') ++i;
bool exp = false, space = false, point = fa...
分类:
其他好文 时间:
2015-02-13 16:38:49
阅读次数:
97
困扰了好久的问题,终于解决了。问题描述:在fcitx的输入法配置栏里,输入法列表是空的,使用Ctrl+space无法启用任何的输入法,当然此截图中的是有的,这是问题已经解决后的状态了。解决方法也是简单暴力:将.config/fcitx目录删除就一切搞定。参考此帖:http://www.findspa...
分类:
其他好文 时间:
2015-02-13 16:26:37
阅读次数:
141
Given a sorted array, remove the duplicates in place such that eachelement appear only once and return the new length.
Do not allocate extra space for another array, you must do this in placewith con...
分类:
其他好文 时间:
2015-02-12 22:52:00
阅读次数:
143
https://oj.leetcode.com/problems/palindrome-number/Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.So...
分类:
其他好文 时间:
2015-02-12 20:01:09
阅读次数:
204
Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of last word in the string.
If the last word does not exist, return 0.
Note: A wor...
分类:
其他好文 时间:
2015-02-12 18:32:44
阅读次数:
173
Java代码规范中提到,tab其实是占8个字符,因此我们可以使用4个空格(4个字符)来代替tab,这样既减少了代码的存储大小,也提供了一种美观的代码。因此修改Eclipse的编码格式有助于我们不用改变我们的习惯而达到替换。具体步骤如下:编辑时,对tab的替换。Windows->Preferen..
分类:
系统相关 时间:
2015-02-12 14:13:57
阅读次数:
222
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 (size that is greater or equa...
分类:
其他好文 时间:
2015-02-11 18:09:29
阅读次数:
159