摘要:        
windows:Calculates the wall-clock time used by the calling process. return:The elapsed wall-clock time since the start of the processLinux:The clock() function returns an approximation of processor time used by the program Windows: 1 #include 2 #include 3 #include 4 5 int main() 6 { 7 printf...    阅读全文
        
            posted @ 2013-12-22 23:14
good90
阅读(653)
评论(0)
推荐(0)
        
        
            
        
        
摘要:        
快速排序使用分治法(Divide and conquer)策略来把一个串行(list)分为两个子串行(sub-lists)。步骤为:从数列中挑出一个元素,称为 "基准"(pivot),重新排序数列,所有元素比基准值小的摆放在基准前面,所有元素比基准值大的摆在基准的后面(相同的数可以到任一边)。在这个分区退出之后,该基准就处于数列的中间位置。这个称为分区(partition)操作。递归地(recursive)把小于基准值元素的子数列和大于基准值元素的子数列排序。伪码:排序1 QuickSort(A, p, r)2 if p A[j]8 exchange A[i + 1] A[    阅读全文
        
            posted @ 2013-12-22 20:29
good90
阅读(368)
评论(0)
推荐(0)
        
        
                    
                
浙公网安备 33010602011771号