2013年3月28日

Longest Substring Without Repeating Characters

摘要: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for “abcabcbb” is “abc”, which the length is 3. For “bbbbb” the longest substring is “b”, with the length of 1. 1 public class Solution { 2 public i... 阅读全文

posted @ 2013-03-28 06:42 Step-BY-Step 阅读(277) 评论(0) 推荐(0) 编辑

最长子串算法优化。。

摘要: 想要降低时间复杂度,从brace 的 N2 变成 N。 肯定要引用两个指针,一个指向头一个指向尾,然后bundle的 来改变这两个指针的位置 已获得需要的数据。。。 适用于最长子串,最需要的子串这一类的 问题。 阅读全文

posted @ 2013-03-28 06:09 Step-BY-Step 阅读(128) 评论(0) 推荐(0) 编辑

Chp9: Recursion and Dynamic Programming

摘要: A goog hint that a problem is recursive is that it can be build off sub-problems.Bottom-Up Recursion:most intuitive, we start with knowing how to solve the problem for a simple case.Up-Bottom Recursion:more complex.Dynamic programming is little more than recursion where you cache the results. A good 阅读全文

posted @ 2013-03-28 05:18 Step-BY-Step 阅读(270) 评论(0) 推荐(0) 编辑

thread and process

摘要: process是进程的意思,它代表程序的一次运行,而一个进程又是由一个以上的线程组成,thread是线程的意思。线程是最小的调度单位,进程是最小的内存分配单位。Both threads and processes are methods of parallelizing an application. However, processes are independent execution units that contain their own state information, use their own address spaces, and only interact with ea 阅读全文

posted @ 2013-03-28 02:15 Step-BY-Step 阅读(234) 评论(0) 推荐(0) 编辑

导航