摘要:
MERGE(A, p, q, r),其中A是个数组,p, q和r是下标。满足p<=q<r.该过程假设子数组A[p..q]和A[q+1..r]都已排好序;MERGE过程的时间代价为Θ(n), 其中n=r-p+1是待合并的元素个数。伪码:MERGE(A, p, q, r) n1 ← q - p + 1 n2 ← r - q create arrays L[1.. n1+1] and R[1.. n2+1] for i ← 1 to n1 do L[i] ← A[p + i - 1] for j ← 1 to n2 do R[j] ← A[q + j] L[n1 + 1] ←... 阅读全文
posted @ 2012-05-05 22:18
qiangzhu
阅读(209)
评论(0)
推荐(0)
摘要:
伪码:INSERTION-SORT(A) for j ← 2 to length(A) do key ← A[j] i ← j - 1 while i > 0 and A[i] > key do A[i + 1] ← A[i] i ← i - 1 A[i + 1] ← keyJava 实现: public void insertionSort(int[] a) { int len = a.length; for (int j = 1; j < len; j++) { i... 阅读全文
posted @ 2012-05-05 21:07
qiangzhu
阅读(169)
评论(0)
推荐(0)
摘要:
HTML elements can be displayed either inblockorinlinestyle.The 3 ways that HTML elements can be displayedAll HTML elements are naturally displayed in one of the following ways:BlockTakes up the full width available, with a new line before and after (display:block;)InlineTakes up only as much width a 阅读全文
posted @ 2012-05-05 19:54
qiangzhu
阅读(572)
评论(0)
推荐(0)
摘要:
This is a problem I’ve come across frequently, and since it has come up again recently, I thought I’d explore this issue in the hope that it will save others some trouble. There are so many problems that this one issue can lead to that it’s baffling browsers still behave this way. The issue? An HTML 阅读全文
posted @ 2012-05-05 19:34
qiangzhu
阅读(239)
评论(0)
推荐(0)
摘要:
As many of you must have read or realised(i did) while working with it, MS Internet Explorer doesn't allow you to set the innerHTML property of any table related tag(table, thead, tbody, tr except for td). It says "Unknown Runtime Exception". You are provided with explicit methods to h 阅读全文
posted @ 2012-05-05 19:33
qiangzhu
阅读(224)
评论(0)
推荐(0)
摘要:
1.CSS Block vs Inline CSS Display Styleshttp://www.webdesignfromscratch.com/html-css/css-block-and-inline/2.Containing Floatshttp://www.complexspiral.com/publications/containing-floats/http://css-tricks.com/all-about-floats/3.CSS Positioninghttp://www.vanseodesign.com/css/css-positioning/4.CSS Organ 阅读全文
posted @ 2012-05-05 19:32
qiangzhu
阅读(235)
评论(0)
推荐(0)
摘要:
Sometimes you want to make a good impression with everyone and seem like you're interested in the rest of the group. Especially when you've just met some new people, it's usually better to lean towards the outgoing end of the scale. Getting that "quiet" label often works agains 阅读全文
posted @ 2012-05-05 19:29
qiangzhu
阅读(546)
评论(0)
推荐(0)
摘要:
1.Refactoringhttp://sourcemaking.com/refactoring2.Inversion of Control Containers and the Dependency Injection patternhttp://martinfowler.com/articles/injection.html3.ConCurrentHashMaphttp://www.ibm.com/developerworks/java/library/j-jtp08223/4..Continuous Integrationhttp://martinfowler.com/articles/ 阅读全文
posted @ 2012-05-05 19:28
qiangzhu
阅读(153)
评论(0)
推荐(0)
摘要:
The Factory Method Pattern defines an interface for creating an object, but lets subclassed decide which classto instantiate. Factory Method lets a class defer instantiation to subclasses.Dependency Inversion PrincipleDepend upon abstractions. Do not depenfd upon concrete classesGuidelies to follow 阅读全文
posted @ 2012-05-05 17:47
qiangzhu
阅读(524)
评论(0)
推荐(0)
浙公网安备 33010602011771号