2013年12月11日

Chp12: Testing

摘要: What the Interviewer is Looking for:Big Picture UnderstandingKnowing How the Pieces Fit TogetherOrganizationParcticalityTesting a Function:Define the test casenormal caseExtremes: empty array? very small? very large?Nulls and "illegal" inputStrange input 阅读全文

posted @ 2013-12-11 03:41 Step-BY-Step 阅读(122) 评论(0) 推荐(0) 编辑

Chp11: Sorting and Searching

摘要: Common Sorting Algo:Bubble Sort: Runime: O(n2) average and worst case. Memory: O(1).1 void BubbleSortArray(){ 2 for(int i=1;ia[j+1]){//比较交换相邻元素 5 int temp; 6 temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; 7 } 8 } Selection Sort:Runtime: O(n2) average and worst case. Memo... 阅读全文

posted @ 2013-12-11 03:27 Step-BY-Step 阅读(446) 评论(0) 推荐(0) 编辑

常见的排序算法之Java代码解释

摘要: 一 简要介绍一般排序均值的是将一个已经无序的序列数据重新排列成有序的常见的排序分为:1插入类排序主要就是对于一个已经有序的序列中,插入一个新的记录。它包括:直接插入排序,折半插入排序和希尔排序2交换类排序这类排序的核心就是每次比较都要“交换”,在每一趟排序都会两两发生一系列的“交换”排序,但是每一趟排序都会让一个记录排序到它的最终位置上。它包括:起泡排序,快速排序3 选择类排序每一趟排序都从一系列数据中选择一个最大或最小的记录,将它放置到第一个或最后一个为位置交换,只有在选择后才交换,比起交换类排序,减少了交换记录的时间。属于它的排序:简单选择排序,堆排序4 归并类排序将两个或两个以上的有序序 阅读全文

posted @ 2013-12-11 02:47 Step-BY-Step 阅读(262) 评论(0) 推荐(0) 编辑

Chp10: Scalability and Memory Limits

摘要: The Step-by-Step Approachbreak down a tricky problem and to solve problems using what you do know.Step 1: Make BelievePretend that the data can all fit on one machine and there are no memory limitations. Provide the general outline for your solution.Step 2: Get Realfigure out how to logically divide 阅读全文

posted @ 2013-12-11 02:04 Step-BY-Step 阅读(211) 评论(0) 推荐(0) 编辑

导航