锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲淫性视频,久久这里只精品最新地址,91久久精品国产91久久性色http://www.shnenglu.com/JonsenElizee/category/13511.htmlSoftware Developing Blog <BR> <BR> "An idea is fragile . It can be killed by a scornful smile or a yawn .It can be mound down by irony and scared to death by a cold look." <BR> "Most cultures throughout human history have not liked creative individuals .They ignore them or kill them.It is a very efficient way of stopping creativity." <BR> <BR> ------Advertising boss Charles Browe and Howard Gardner ,professor at Harvard zh-cnMon, 01 Nov 2010 14:47:43 GMTMon, 01 Nov 2010 14:47:43 GMT60Pthread Tutorialhttp://www.shnenglu.com/JonsenElizee/archive/2010/11/01/131984.htmlJonsenElizeeJonsenElizeeMon, 01 Nov 2010 06:20:00 GMThttp://www.shnenglu.com/JonsenElizee/archive/2010/11/01/131984.htmlhttp://www.shnenglu.com/JonsenElizee/comments/131984.htmlhttp://www.shnenglu.com/JonsenElizee/archive/2010/11/01/131984.html#Feedback0http://www.shnenglu.com/JonsenElizee/comments/commentRss/131984.htmlhttp://www.shnenglu.com/JonsenElizee/services/trackbacks/131984.html闃呰鍏ㄦ枃

JonsenElizee 2010-11-01 14:20 鍙戣〃璇勮
]]>
Quicker Quick-Sort http://www.shnenglu.com/JonsenElizee/archive/2010/09/23/127418.htmlJonsenElizeeJonsenElizeeThu, 23 Sep 2010 07:24:00 GMThttp://www.shnenglu.com/JonsenElizee/archive/2010/09/23/127418.htmlhttp://www.shnenglu.com/JonsenElizee/comments/127418.htmlhttp://www.shnenglu.com/JonsenElizee/archive/2010/09/23/127418.html#Feedback0http://www.shnenglu.com/JonsenElizee/comments/commentRss/127418.htmlhttp://www.shnenglu.com/JonsenElizee/services/trackbacks/127418.html鍏充簬蹇熸帓搴?/strong>

鎴戜滑閮界煡閬撳揩閫熸帓搴忔湁寰堝ソ鐨?/font>O(nlogn)錛岄偅涔堟洿蹇殑蹇熸帓搴忓湪鍝噷鍛紵涓嬮潰鏄垜鐨勫涔犺褰曘?/font>

錛嶏紞By JonsenElizee 2010/09/23

甯歌鐨勫揩閫熸帓搴?/font>

瀛︿範蹇熸帓搴忥紝鏈璁╀漢鐔熸倝鐨勬槸涓や釜ptr宸﹀彸鏉ュ洖鎸囷紝涓嬈℃帓搴忓悗灝辨妸涓涓?/font>mid鍊兼斁鍦ㄤ簡鍚堥傜殑浣嶇疆涓娿傝繖鏄垜涓涓湅鍙嬬殑闈為掑綊鐨?/font>C錛嬶紜瀹炵幇銆傛垜鏀瑰啓涓鐐圭偣錛屽氨鏄姞浜?/font>C鐨?/font>rand()鏉ヨ緗暟緇勫鹼紝鐒跺悗緙栬瘧榪愯榪欎釜綆楁硶錛屼綘鍙兘榪樹笉鑳介殢闅忎究渚跨殑鍐欏嚭榪欎釜綆楁硶錛屼絾鏁堟灉鐪熺殑寰堜笉涔愯錛屼篃涓嶇煡閬撹榪愯澶氫箙鎵嶈兘鎺掑簭瀹?6*50鐨勫瓧絎︿覆銆傚悗闈㈡垜浠細鐪嬪埌涓涓緢綺炬倣鐨勭畻娉曘傘傘?/font>

 1 #include <stack>
 2 #include <vector>
 3 #include <iostream>
 4 #include <stdlib.h>
 5 #include <stdio.h>
 6 #include <time.h>
 7 
 8 using namespace std;
 9 
10 typedef struct _record
11 {
12     int begin;
13     int end;
14 }record;
15 
16 void quick_sort(int a[],int len)
17 {
18     vector<record> do_job;
19     record temp;
20     temp.begin = 0;
21     temp.end = len-1;
22     do_job.push_back(temp);
23 
24     while (do_job.size()  != 0) {
25         record temp = do_job.back();
26         do_job.pop_back();
27     
28         int low = temp.begin;
29         int high = temp.end;
30         int key = a[low];
31         while (low < high) {
32             while(low < high && a[high] >= key) high--;
33             a[low] = a[high];
34             while(low < high && a[low] <= key) low++;
35             a[high] = a[low];
36         }
37         a[low] = key;
38 
39         record temp1;
40         temp1.begin = temp.begin;
41         temp1.end = low-1;
42         if (temp1.begin < temp1.end) { do_job.push_back(temp1); }
43 
44         record temp2;
45         temp2.begin = low+1;
46         temp2.end = temp.end;
47         if (temp2.begin < temp2.end) { do_job.push_back(temp2); }
48     }
49 }
50 int main()
51 {
52     int a[26*50];
53     int i = 0;
54     while(i < 26*50) a[i] = rand() % 100;
55     int count =sizeof(a) / sizeof(int);
56     quick_sort(a,count);
57     for (int i = 0; i < count; i++) cout<<a[i]<<endl;
58     return 0;
59 }
60 


鏇寸畝鏇村揩蹇熸帓搴?/font>

榪欑蹇熸帓搴忎笉鏄渶蹇殑錛岀壒鍒槸鍩烘湰鏈夊簭鏃朵細閫鍖栧埌O(n^2)錛岀悊璁轟笂鍩轟簬姣旇緝鐨勬帓搴忎笉浼氬皬浜?/font>O(nlogn)錛屼絾榪樻槸鏈夊姞閫熺殑鍙兘銆備笅闈㈣繖涓槸銆?/font>Programming Pearls 2nd銆嬮噷闈㈢殑鏂規硶錛岃繖涓畻娉曠湡鐨勫緢綺炬倣錛岃繍琛屽畬26*50鐨勪竴涓帓搴忥紝鍙渶瑕?.09縐掞紝鎴戠殑瀹炵幇濡備笅銆?/font>


榪愯鏃舵槸緇欑殑涓涓暱搴︿負26*50鐨勪竴涓瓧絎︽暟緇勶紝瀵瑰畠榪涜鎺掑簭錛?/font>



鏇寸畝鏇村揩蹇熸帓搴忥紜錛?/font>

鐮旂┒涓婇潰綆楁硶鐨勬墽琛岃繃紼嬶紝閬靛驚澶у笀鐨勬濊礬錛屾垜鏀瑰啓浜嗙畻娉曪紝鍦ㄦ垜鐨?/font>X61錛?/font>Redhat EL5涓婅繍琛岄熷害姣斾笂闈㈢殑綆楁硶蹇簡8鍊嶏紝涔熷氨鏄繍琛屽畬26*50闀跨殑鎺掑簭錛屽彧闇瑕?.01縐掞紒鏈鍚庢垜鏄庣櫧涓涓亾鐞嗭紝瑕佹湁鎬濇兂錛岃鏈夋瘏鍔涳紝瑕佹湁瀹炶返銆傚畬紼挎椂錛屾垜鍙戠幇榪欎釜綆楁硶榪樻湁鏀硅繘鐨勪綑鍦般傜壒鍜屽ぇ瀹跺垎浜傚澶氭寚鐐廣?/font>

榪愯杈撳叆鍜?/font>quick.c涓殑涓鏍鳳細

榪愯緇撴灉瀵規瘮

甯歌鐨勯偅涓潪閫掑綊鐨勭畻娉曚粠鎴戝啓榪欎釜鏂囦歡鍒扮幇鍦紝瀹冭繕鍦ㄨ繍琛岀潃銆傘傘?/font>

絎簩涓拰絎笁涓椂闂村姣斿涓嬪浘錛?/font>

(鍔犱笉鍔犱紭鍖栵紞O3閮芥槸涓鏍風殑緇撴灉錛屽湪鎴戠殑X61涓婏紝gcc version 4.1.2 20080704 (Red Hat 4.1.2-48))


鏀硅繘鐨?/font>myquick.c鐨勮繍琛屾椂闂存槸quick.c鐨?/font>1/9銆?/font>

鏈鍚庯紝鎴戜笉寰椾笉鐢?/font>Ctrl錛?/font>C鎶婇偅涓父瑙勭殑緇?/font>KILL鎺夈?/font>

Real, User and Sys process time statistics

One of these things is not like the other. Real refers to actual elapsed time; User and Sys refer to CPU time used only by the process.
    *Real is wall clock time - time from start to finish of the call. This is all elapsed time including time slices used by other processes and time the process spends blocked (for example if it is waiting for I/O to complete).
    *User is the amount of CPU time spent in user-mode code (outside the kernel) within the process. This is only actual CPU time used in executing the process. Other processes and time the process spends blocked do not count towards this figure.
    *Sys is the amount of CPU time spent in the kernel within the process. This means executing CPU time spent in system calls within the kernel, as opposed to library code, which is still running in user-space. Like 'user', this is only CPU time used by the process.
      User+Sys will tell you how much actual CPU time your process used.

 

婧愪唬鐮?/font>

鏍稿績綆楁硶瀵規瘮鍥?/font>



quick.c婧愪唬鐮?/font>

 1 #include <stdio.h>
 2 #include <string.h>
 3 #include <stdlib.h>
 4 #include <time.h>
 5 
 6 void quick(char* str, int low, int hig);
 7 void swap(char* a, char* b);
 8 
 9 int main()
10 {
11     char ary[] = 錛忥紡26錛?0闀跨殑瀛楃涓叉暟緇勶紝鍐呭鍙傝冧笂鍥俱?/span>
12     char* str = ary;
13     printf("calling quick");
14     quick(str, 0, strlen(str)-1);
15     return 0;
16 }
17 
18 void quick(char* str, int low, int hig) {
19     if(low >= hig) return;
20     srand(time(NULL));
21     // get a random key
22     //swap(str + low, str + low + (rand() % (hig - low + 1)));
23     int i = low, j = hig + 1, key = str[low];
24     while(1)
25     {
26         while(++<= hig && str[i] <= key);
27         while(-->= low && str[j] >  key);
28         if(i > j) break// no need to do swap
29         swap(str + i, str + j);
30     }
31     swap(str + low, str + i - 1); // swap key to i-1 position
32     quick(str, low, i - 2);
33     quick(str, i, hig);
34 }
35 
36 void swap(char* a, char* b) {
37     if(a == b) return;
38     *^= *b; *^= *a; *^= *b;
39 }
40 

 

 

myquick.c婧愪唬鐮?/font>

 1 #include <stdio.h>
 2 #include <string.h>
 3 #include <stdlib.h>
 4 #include <time.h>
 5 
 6 void myquick(char* str, int low, int hig);
 7 void swap(char* a, char* b);
 8 
 9 int main()
10 {
11     char ary[] = 錛忥紡26錛?0闀跨殑瀛楃涓詫紝鍚宷uick.c鐨勮緭鍏ャ?/span>
12     char* str = ary;
13     printf("calling myquick");
14     myquick(str, 0, strlen(str)-1);
15     return 0;
16 }
17 
18 void myquick(char* str, int low, int hig) {
19     if(low >= hig) return;// no need to sort elements
20     // elements in the right of [m] are not sorted
21     int m = low, i = low, j = hig, key = low;
22     // skip any elements that <= [key]
23     while(i <= hig && str[i] <= str[key]) {i++; m++;}
24     // skip elements > [key]
25     while(j >= low && str[j] > str[key]) j--;
26     // initially, i==j is impossible
27     while(i <= j) {
28         // swap small one to m-position
29         if(str[i] <= str[key]) { swap(str + m++, str + i); }
30         i++;
31     }
32     swap(str + low, str + m-1);
33     myquick(str, low, m - 2);
34     myquick(str, m, hig);
35     return;
36 }
37 
38 void swap(char* a, char* b) {
39     if(a == b) return;
40     *^= *b; *^= *a; *^= *b;
41 }
42 






]]>
Difference of GDB/MI to GDBServerhttp://www.shnenglu.com/JonsenElizee/archive/2010/08/20/124039.htmlJonsenElizeeJonsenElizeeThu, 19 Aug 2010 16:47:00 GMThttp://www.shnenglu.com/JonsenElizee/archive/2010/08/20/124039.htmlhttp://www.shnenglu.com/JonsenElizee/comments/124039.htmlhttp://www.shnenglu.com/JonsenElizee/archive/2010/08/20/124039.html#Feedback0http://www.shnenglu.com/JonsenElizee/comments/commentRss/124039.htmlhttp://www.shnenglu.com/JonsenElizee/services/trackbacks/124039.html
    gdb and gdb/mi are essentially the same, except that gdb/mi lets you select the MI protocol version and command set to use (MI - or Machine Interface - is how Eclipse communicates with gdb, rather than using the normal gdb command-line interface). This is useful if you want to do something not supported by the defaults, or have a non-standard gdb, such as used on Mac OS X. gdbserver is a very lightweight debug server used for debugging embedded systems. The normal gdb/mi commands are used, but gdb must be told to connect to a gdbserver running on a remote system. There's an extra tab for specifying this information.

]]>
日韩欧美亚洲综合久久| 久久久免费观成人影院| 久久五月精品中文字幕| 99热热久久这里只有精品68| 久久精品免费大片国产大片| 无码伊人66久久大杳蕉网站谷歌| 99久久精品国内| 久久亚洲视频| 久久精品国产99久久无毒不卡| 伊人久久大香线蕉综合5g| 久久婷婷国产综合精品| 久久精品视频一| 久久人人爽人人精品视频| 久久精品毛片免费观看| 亚洲人成网站999久久久综合| 韩国免费A级毛片久久| 日产精品久久久久久久| 伊人色综合久久天天| 伊人热人久久中文字幕| 久久综合亚洲色一区二区三区| 精品久久久久久无码中文字幕| 欧美熟妇另类久久久久久不卡| 久久久久一级精品亚洲国产成人综合AV区 | 精品久久久无码21p发布| 久久精品国产亚洲精品| 国产精品久久成人影院| 久久久久亚洲AV无码专区体验| 久久婷婷五月综合国产尤物app| 久久精品视频91| 无码任你躁久久久久久久| 久久美女网站免费| 久久成人精品| 国产三级精品久久| 久久久久久久99精品免费观看| 久久香蕉国产线看观看精品yw| 久久精品极品盛宴观看| 久久精品亚洲AV久久久无码| 久久亚洲精品成人无码网站| 久久久久亚洲av成人网人人软件| 久久久久久精品成人免费图片| 香港aa三级久久三级老师2021国产三级精品三级在 |