摘要: 【leetcode】409. Longest Palindrome Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can 阅读全文
posted @ 2016-10-26 10:37 SarahLiu77 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 【leetcode】438. Find All Anagrams in a String Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consi 阅读全文
posted @ 2016-10-26 10:22 SarahLiu77 阅读(632) 评论(0) 推荐(0) 编辑
摘要: 斐波那契数列(Fibonacci sequence),又称黄金分割数列、因数学家列昂纳多·斐波那契(Leonardoda Fibonacci)以兔子繁殖为例子而引入,故又称为“兔子数列”,指的是这样一个数列:0、1、1、2、3、5、8、13、21、34、……在数学上,斐波纳契数列以如下被以递归的方法 阅读全文
posted @ 2016-10-26 09:28 SarahLiu77 阅读(735) 评论(0) 推荐(0) 编辑
摘要: 【LeetCode】First Missing Positive Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3 阅读全文
posted @ 2016-10-25 16:12 SarahLiu77 阅读(128) 评论(0) 推荐(0) 编辑
摘要: [LeetCode] 42. Trapping Rain Water Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much wate 阅读全文
posted @ 2016-10-25 14:42 SarahLiu77 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 【LeetCode】57. Insert Interval Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume 阅读全文
posted @ 2016-10-21 14:31 SarahLiu77 阅读(426) 评论(0) 推荐(0) 编辑
摘要: 75. Sort Colors 问题描述: 给一个包含n个数字的数组,其中有0,1,2;排序使得所有相同的数字相邻,且按照0,1,2的顺序。 思路: (1)计数排序: 需要扫两遍数组,一遍统计个数,第二遍开始摆放数字。 代码如下: (2)如果只能扫一遍,很容易想到的就是左边存放0和1,右边存放2.两 阅读全文
posted @ 2016-10-19 19:02 SarahLiu77 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 1.Word Ladder 问题描述: 给两个word(beginWord和endWord)和一个字典word list,找出从beginWord到endWord之间的长度最长的一个序列,条件: 1.字典中的每个单词只能使用一次; 2.序列中的每个单词都必须是字典中的单词; 例如: Given:be 阅读全文
posted @ 2016-10-19 11:37 SarahLiu77 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 1、 守护进程的概念: 守护进程(Daemon)是一种运行在后台的一种特殊的进程,它独立于控制终端并且周期性的执行某种任务或等待处理某些发生的事件。由于在linux中,每个系统与用户进行交流的界面成为终端,每一个从此终端开始运行的进程都会依附于这个终端,这个终端被称为这些进程的控制终端,当控制终端被 阅读全文
posted @ 2016-10-17 11:20 SarahLiu77 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 说起fork就不得不提COW(Copy On Write),就是“写时拷贝”。也就是当fork发生时,子进程根本不会去拷贝父进程的内存页面,而是与父进程共享。当子进程或父进程需要修改一个内存页面时,Linux就将这个内存页面复制一份给修改者,然后再去修改,这样从用户的角度看,父子进程根本就没有共享什 阅读全文
posted @ 2016-10-17 11:14 SarahLiu77 阅读(716) 评论(0) 推荐(0) 编辑