亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? c-

?? C實例解析精粹
??
?? 第 1 頁 / 共 2 頁
字號:

         /*
          * now, lets look at the low list and the high list.  save the node
          *  pointers and counters of the longest sublist on the stack.
          *  then, quicksort the shortest sublist.
          */
         if (low_count > high_count) {

            /*
             * if fewer than 25 nodes in the high count, don't bother to
             *  push the stack -- sort the low list.
             */
            if (high_count > 25) {
               low_rline_stack[stack_pointer]  = low;
               high_rline_stack[stack_pointer] = low + low_count - 1;
               low_node_stack[stack_pointer]   = low_head;
               high_node_stack[stack_pointer]  = low_tail;
               ++stack_pointer;
               low       = high - high_count + 1;
               high      = high;
               low_node  = high_head;
               high_node = high_tail;
            } else {
               low       = low;
               high      = low + low_count - 1;
               low_node  = low_head;
               high_node = low_tail;
            }
         } else {

            /*
             * if fewer than 25 nodes in the low count, don't bother to
             *  push the stack -- sort the high list.
             */
            if (low_count > 25) {
               low_rline_stack[stack_pointer]  = high - high_count + 1;
               high_rline_stack[stack_pointer] = high;
               low_node_stack[stack_pointer]   = high_head;
               high_node_stack[stack_pointer]  = high_tail;
               ++stack_pointer;
               low       = low;
               high      = low + low_count - 1;
               low_node  = low_head;
               high_node = low_tail;
            } else {
               low       = high - high_count + 1;
               high      = high;
               low_node  = high_head;
               high_node = high_tail;
            }
         }

         assert( stack_pointer < 24 );
      }

      /*
       * now that we have sorted the smallest sublist, we need to pop
       *  the long sublist(s) that were pushed on the stack.
       */
      --stack_pointer;
      if (stack_pointer < 0)
         break;
      low       = low_rline_stack[stack_pointer];
      high      = high_rline_stack[stack_pointer];
      low_node  = low_node_stack[stack_pointer];
      high_node = high_node_stack[stack_pointer];
   }
}


/*
 * Name:    insertion_sort_block
 * Purpose: sort small partitions passed in by qsort
 * Date:    January 10, 1993
 * Passed:  low:          starting line in box block
 *          high:         ending line in a box block
 *          first_node:   first linked list node to sort
 * Notes:   Insertion sort the lines in the BOX buff according to stuff in
 *           a box block.
 */
void insertion_sort_block( long low, long high, line_list_ptr first_node )
{
long down;                      /* relative line number for insertion sort */
long pivot;                     /* relative line number of pivot in block */
long count;
line_list_ptr pivot_node;       /* pointer to actual text in block */
line_list_ptr down_node;        /* pointer used to compare text */
text_ptr key;
int  dirty_flag;
int  len;

   /*
    * make sure we have more than 1 line to sort.
    */
   if (low < high) {

      count = (int)(high - low) + 1;
      pivot_node = first_node->next;
      for (pivot=1; pivot < count; pivot++) {
         load_pivot( pivot_node );
         key = pivot_node->line;
         len = pivot_node->len;
         dirty_flag = pivot_node->dirty;
         down_node = pivot_node;
         for (down=pivot-1; down >= 0; down--) {
            /*
             * lets keep comparing the keys until we find the hole for
             *  pivot.
             */
            if (compare_pivot( down_node->prev ) > 0) {
               down_node->line = down_node->prev->line;
               down_node->len = down_node->prev->len;
               down_node->dirty = down_node->prev->dirty;
            } else
               break;
            down_node = down_node->prev;
         }
         down_node->line = key;
         down_node->len  = len;
         down_node->dirty = (char)dirty_flag;
         pivot_node = pivot_node->next;
      }
   }
}


/*
 * Name:    load_pivot
 * Purpose: load pivot point for insertion sort
 * Date:    June 5, 1992
 * Passed:  text:  line that contains the pivot
 */
void load_pivot( line_list_ptr node )
{
   sort.pivot_ptr = node->line;
   sort.pivot_len = node->len;
}


/*
 * Name:    compare_pivot
 * Purpose: compare pivot string with text string
 * Date:    June 5, 1992
 * Passed:  text:  pointer to current line
 * Notes:   the sort structure keeps track of the pointer to the pivot line
 *           and the pivot line length.
 */
int  compare_pivot( line_list_ptr node )
{
register int len;
register int bc;
int  rc;
int  left_over;

   len = node->len;
   bc  = sort.bc;

   assert( bc >= 0 );
   assert( len >= 0 );

   /*
    * is the current line length less than beginning column?  if so, just
    *  look at the length of the pivot line.  no need to compare keys.
    */
   if (len < bc+1) {
      if (sort.pivot_len < bc+1)
         return( 0 );
      else
         return( sort.direction == ASCENDING ?  -1 : 1 );

   /*
    * is the pivot line length less than beginning column?  if so, just
    *  look at the length of the current line.  no need to compare keys.
    */
   } else if (sort.pivot_len < bc+1) {
      if (len < bc+1)
         return( 0 );
      else
         return( sort.direction == ASCENDING ?  1 : -1 );
   } else {

      /*
       * if lines are of equal length or greater than the ending column,
       *  then lets consider them equal.
       */
      if (len == sort.pivot_len)
         left_over = 0;
      else if (len > sort.ec  &&  sort.pivot_len > sort.ec)
         left_over = 0;
      else {

         /*
          * if one line does not extend thru the ending column, give
          *  preference to the longest key.
          */
         if (sort.direction == ASCENDING)
            left_over =  len > sort.pivot_len ? 1 : -1;
         else
            left_over =  len > sort.pivot_len ? -1 : 1;
      }

      /*
       * only need to compare up to length of the key in the pivot line.
       */
      if (len > sort.pivot_len)
         len = sort.pivot_len;
      len = len - bc;
      if (len > sort.block_len)
         len = sort.block_len;

      assert( len > 0 );

      if (sort.direction == ASCENDING)
         rc = my_memcmp( node->line + bc, sort.pivot_ptr + bc, len );
      else
         rc = my_memcmp( sort.pivot_ptr + bc, node->line + bc, len );

      /*
       * if keys are equal, let's see if one key is longer than the other.
       */
      if (rc == 0)
         rc = left_over;
      return( rc );
   }
}


/*
 * Name:    my_memcmp
 * Purpose: compare strings using ignore or match case sort order
 * Date:    October 31, 1992
 * Passed:  s1:  pointer to string 1
 *          s2:  pointer to string 2
 *          len: number of characters to compare
 * Notes:   let's do our own memcmp, so we can sort languages that use
 *           extended characters as part of their alphabet.
 */
int  my_memcmp( text_ptr s1, text_ptr s2, int len )
{
unsigned char *p;
register int c;

   assert( len >= 0 );
   assert( len < MAX_LINE_LENGTH );
   assert( s1 != NULL );
   assert( s2 != NULL );

   if (len == 0)
      return( 0 );

   p = sort.order_array;

   /*
    * the C comparison function is equivalent to the assembly version;
    *  however, once the assembly routine initializes, it is much faster
    *  than the C version.
    */
   if (len < 10) {
      for (;len > 0  &&  (c = (int)p[*s1] - (int)p[*s2]) == 0;
                                              s1++, s2++, len--);
      return( c );
   } else {

      ASSEMBLE {

   /*
   ; Register strategy:
   ;   ax  == *s1
   ;   dx  == *s2
   ;   ds:[si]  == s1
   ;   es:[bx]  == s2
   ;   bp       == sort.order_array
   ;   [bp+di]  == p[*s1]  or  p[*s2]
   ;   cx       == len
   ;
   ;  CAVEAT:  sort.order_array is assumed to be located in the stack segment
   */

        push    ds                      /* push required registers */
        push    si
        push    di
        push    bp

        xor     ax, ax                  /* zero ax */
        mov     cx, WORD PTR len        /* keep len in cx */
        cmp     cx, 0                   /* len <= 0? */
        jle     get_out                 /* yes, get out */

        mov     bx, WORD PTR s2         /* load our registers */
        mov     ax, WORD PTR s2+2
        mov     es, ax                  /* es:[bx] = s2 */
        mov     si, WORD PTR s1
        mov     ax, WORD PTR s1+2
        mov     ds, ax                  /* ds:[si] = s1 */
        mov     bp, p                   /* [bp] = p */
        xor     ax, ax                  /* zero out ax */
        xor     dx, dx                  /* zero out dx */
      }
top:

   ASSEMBLE {
        mov     al, BYTE PTR ds:[si]    /* al == *s1 */
        mov     di, ax
        mov     al, BYTE PTR [bp+di]    /* al == p[*s1] */
        mov     dl, BYTE PTR es:[bx]    /* dl == *s2 */
        mov     di, dx
        mov     dl, BYTE PTR [bp+di]    /* dl == p[*s2] */
        sub     ax, dx                  /* ax == p[*s1] - p[*s2] */
        jne     get_out
        inc     bx
        inc     si
        dec     cx
        cmp     cx, 0
        jg      top                     /* ax keeps the return value */
      }
get_out:

   ASSEMBLE {
        pop     bp                      /* pop the registers we pushed */
        pop     di
        pop     si
        pop     ds                      /* ax keeps the return value */
      }
   }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区在线视频| 日韩一级高清毛片| 日本亚洲视频在线| 久久久久88色偷偷免费| 亚洲色图丝袜美腿| 成人免费毛片片v| 日韩午夜av一区| 日本麻豆一区二区三区视频| 激情综合网激情| 欧美精品一二三区| 亚洲男人的天堂av| 99精品在线观看视频| 亚洲成人777| 亚洲男人天堂一区| 婷婷丁香激情综合| 国产精品精品国产色婷婷| 51精品国自产在线| 日本伦理一区二区| 东方欧美亚洲色图在线| 激情综合五月天| 免费成人你懂的| 亚洲午夜视频在线| 亚洲欧美韩国综合色| 国产亚洲精品aa| 久久久久久久久久美女| 日韩欧美在线不卡| 欧美一级欧美三级| 欧美日韩在线直播| 在线一区二区三区| 一本大道av一区二区在线播放| 国产凹凸在线观看一区二区| 国产精品一区二区在线看| 日本亚洲免费观看| 美女一区二区在线观看| 国产宾馆实践打屁股91| 欧美日韩成人综合天天影院| 中文字幕免费不卡| 欧美日韩高清影院| 盗摄精品av一区二区三区| 日韩精品在线一区二区| 亚洲图片欧美一区| 国产亚洲欧美一区在线观看| 欧美情侣在线播放| 国产一区亚洲一区| 国产成人在线视频播放| 久久久精品国产99久久精品芒果 | 久久久久久久久99精品| 欧美一区二区福利在线| 日韩欧美资源站| 欧美成人艳星乳罩| 久久久久久一级片| 亚洲国产精品黑人久久久| 国产三级精品在线| 国产精品视频一二| 亚洲欧洲综合另类| 亚洲一区二区黄色| 日本美女一区二区三区| 蜜臂av日日欢夜夜爽一区| 极品少妇xxxx精品少妇偷拍| 国产91精品一区二区| 成人激情av网| 欧美视频一二三区| 日韩欧美另类在线| 中文字幕av资源一区| 亚洲欧美另类在线| 日本va欧美va精品发布| 国产河南妇女毛片精品久久久| 不卡av电影在线播放| 欧美日精品一区视频| 欧美精品一区二区蜜臀亚洲| 国产精品热久久久久夜色精品三区 | 91福利小视频| 日韩一区二区免费在线观看| 国产日韩成人精品| 一区二区三区欧美久久| 免费观看一级欧美片| 成人爽a毛片一区二区免费| 91久久精品午夜一区二区| 91精品国产综合久久久久久久久久| 欧美成人官网二区| 成人免费一区二区三区视频| 日本sm残虐另类| av资源站一区| 91精品国产综合久久久久久久久久| 亚洲国产精品99久久久久久久久 | 国产电影一区二区三区| 欧美在线一二三四区| 久久久久久久综合日本| 亚洲五月六月丁香激情| 国产乱码字幕精品高清av | 91免费版pro下载短视频| 91精品国产一区二区人妖| 国产蜜臀97一区二区三区| 亚洲国产一区二区视频| 国产成人综合在线| 欧美丰满美乳xxx高潮www| 中文字幕第一区二区| 日韩av高清在线观看| 成人av在线一区二区| 欧美成人综合网站| 亚洲综合激情另类小说区| 国产成人自拍网| 日韩片之四级片| 亚洲国产一区在线观看| 99视频超级精品| 国产三级欧美三级日产三级99| 午夜精品爽啪视频| 色综合亚洲欧洲| 国产亚洲一二三区| 全国精品久久少妇| 欧美体内she精高潮| 日韩理论片中文av| 成人夜色视频网站在线观看| 日韩精品在线一区| 免费在线欧美视频| 欧美色偷偷大香| 亚洲激情av在线| www.视频一区| 欧美国产日韩a欧美在线观看| 青青青伊人色综合久久| 欧美三级三级三级| 亚洲精品国产精品乱码不99| av成人免费在线观看| 国产农村妇女精品| 国产成人在线免费| 国产亚洲精品aa| 国产毛片一区二区| 久久精品亚洲精品国产欧美kt∨| 麻豆91精品视频| 精品日本一线二线三线不卡| 日本在线不卡视频| 91精品国产综合久久久蜜臀图片| 午夜a成v人精品| 欧美一区二区三区在线观看 | 成人av网在线| 中文在线一区二区| 成人高清伦理免费影院在线观看| 亚洲成人免费视| 欧美性猛交xxxxxx富婆| 亚洲欧美日韩中文字幕一区二区三区| 成人免费看视频| 综合久久久久久| 91麻豆精品一区二区三区| 亚洲美女屁股眼交| 欧美亚洲尤物久久| 日韩不卡手机在线v区| 日韩精品中文字幕一区| 国产麻豆9l精品三级站| 国产欧美一区二区在线观看| 成人福利视频在线| 樱花影视一区二区| 欧美日本韩国一区| 久久99精品久久久久久动态图| 精品福利av导航| 成人精品国产免费网站| 一区二区三区蜜桃| 777午夜精品免费视频| 九色综合国产一区二区三区| 国产日韩高清在线| 91精品福利在线| 久久精品国产亚洲aⅴ| 国产校园另类小说区| 一本到不卡免费一区二区| 午夜影视日本亚洲欧洲精品| 日韩精品在线看片z| 成人美女在线视频| 亚欧色一区w666天堂| 91麻豆精品国产91久久久久久久久| 激情小说亚洲一区| 亚洲欧洲精品一区二区三区| 精品视频一区三区九区| 国产一区二区网址| 亚洲人亚洲人成电影网站色| 91精品久久久久久久久99蜜臂| 国产精品一区二区在线播放 | 在线观看91av| 国产精品一级黄| 亚洲一区二区不卡免费| 欧美一区二区三区四区久久 | 在线观看一区二区精品视频| 麻豆久久久久久| 亚洲精品乱码久久久久久| 日韩欧美一区在线| 91女神在线视频| 国产一区二区中文字幕| 亚洲国产色一区| 欧美国产一区二区| 欧美一级欧美一级在线播放| 99精品视频一区二区| 久久99在线观看| 夜夜嗨av一区二区三区四季av | 欧美日韩免费电影| 国产精品资源站在线| 首页亚洲欧美制服丝腿| 99国产精品久久久久久久久久久| 亚洲欧洲av色图| 欧美不卡在线视频| 欧美日韩三级一区二区| 国产在线观看一区二区| 亚洲不卡一区二区三区|