Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.Follow up: Did you use extra space?A straight forward sol...
分类:
其他好文 时间:
2015-10-04 17:14:04
阅读次数:
176
Sort a linked list inO(nlogn) time using constant space complexity.class Solution {public: ListNode *sortList(ListNode *head) { if(!head || ...
分类:
其他好文 时间:
2015-10-03 10:40:19
阅读次数:
138
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note:You may assume that nums1 has enough space (size tha...
分类:
其他好文 时间:
2015-10-03 08:25:03
阅读次数:
178
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-10-02 22:33:52
阅读次数:
206
Given two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:You may assume thatnums1has enough space (size that is great...
分类:
编程语言 时间:
2015-10-02 21:07:31
阅读次数:
174
Using paging as the core mechanism to support virtual memeory can lead to high performanceoverheads. By chopping the address space into small, fixed-s...
分类:
其他好文 时间:
2015-10-02 01:28:25
阅读次数:
441
Fenwick Tree is perfect for this problem, though space complexity is not quite efficient.class Solution { ////////////////// // Fenwick Tree // ...
分类:
其他好文 时间:
2015-10-01 11:32:57
阅读次数:
147
1 #include 2 #define N 95 //可打印字符总数 3 #define space 32 //空格符ASCII码 4 5 int main() 6 { 7 char cNum[N] = {0}, ch; 8 int iNum[N] = {0}; 9 ...
分类:
其他好文 时间:
2015-10-01 06:57:35
阅读次数:
202
linux开机简略流程:POST-->bootloader-->kernel-->usr_space_Application##############################################################################POST阶段:计算机加电后,处理器执行的第一条指令定位到BIOS芯片(ROM)把ROM中的程序加载到内存,接着会跳转..
分类:
其他好文 时间:
2015-10-01 01:48:09
阅读次数:
793
Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a...
分类:
其他好文 时间:
2015-09-30 06:21:47
阅读次数:
218