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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

??

?? C語言實戰(zhàn)105例源碼--私藏很久的源碼.zip
??
?? 第 1 頁 / 共 2 頁
字號:

#include "tdestr.h"
#include "common.h"
#include "tdefunc.h"
#include "define.h"


/*
 * Name:    sort_box_block
 * Purpose: sort lines according to text in marked BOX block
 * Date:    June 5, 1992
 * Passed:  window:  pointer to current window
 * Notes:   quick sort and insertion sort the lines in the BOX buff according
 *           to stuff in a box block.
 */
int  sort_box_block( WINDOW *window )
{
int  prompt_line;
int  block_type;
line_list_ptr ll;
register file_infos *file;
WINDOW *sw;
int  rc;
char line_buff[(MAX_COLS+1)*2]; /* buffer for char and attribute  */

   /*
    * make sure block is marked OK
    */
   rc = OK;
   prompt_line = window->bottom_line;
   entab_linebuff( );
   if (un_copy_line( window->ll, window, TRUE ) == ERROR)
      return( ERROR );
   check_block( );
   if (g_status.marked == TRUE) {
      file  = g_status.marked_file;
      block_type = file->block_type;
      if (block_type == BOX) {
         /*
          * sort ascending or descending?
          */
         rc = get_sort_order( window );
         if (rc != ERROR) {
            file->modified = TRUE;
            if (mode.do_backups == TRUE) {
               sw = g_status.window_list;
               for (; ptoul( sw->file_info ) != ptoul( file );)
                  sw = sw->next;
               backup_file( sw );
            }

            /*
             * figure the width of the block.
             */
            sort.block_len = file->block_ec + 1 - file->block_bc;

            /*
             * save the prompt line and print the quicksort message.
             */
            save_screen_line( 0, prompt_line, line_buff );
            eol_clear( 0, prompt_line, g_display.text_color );
            set_prompt( block22a, prompt_line );

            /*
             * set up the sort structure.
             */
            sort.bc  = g_status.marked_file->block_bc;
            sort.ec  = g_status.marked_file->block_ec;
            sort.order_array = (mode.search_case == IGNORE) ?
                                    sort_order.ignore : sort_order.match;

            /*
             * save the previous node for use with insertion sort.
             */
            ll = file->block_start->prev;
            quick_sort_block( file->block_br, file->block_er,
                              file->block_start, file->block_end );

            /*
             * get back previous node and clean up list with insertion
             *   sort.
             */
            if (ll == NULL)
               ll = file->line_list;
            else
               ll = ll->next;
            set_prompt( block22b, prompt_line );
            insertion_sort_block( file->block_br, file->block_er, ll );

            /*
             * housekeeping.  mark the file as dirty and restore the
             *   cursors, which are scrambled during the sort.
             */
            file->dirty = GLOBAL;
            restore_cursors( file );
            restore_screen_line( 0, prompt_line, line_buff );
         }
      } else {
         /*
          * can only sort box blocks
          */
         error( WARNING, prompt_line, block23 );
         rc = ERROR;
      }
   } else {
      /*
       * box not marked
       */
      error( WARNING, prompt_line, block24 );
      rc = ERROR;
   }
   return( rc );
}


/*
 * Name:    quick_sort_block
 * Purpose: sort lines according to text in marked BOX block
 * Date:    Jaunary 10, 1993
 * Passed:  low:        starting line in box block
 *          high:       ending line in a box block
 *          low_node:   starting node in box block
 *          high_node:  ending node in box block
 * Notes:   Quicksort lines in the BOX block according to keys in
 *           a box block.
 *          because the median of three method is used to find the partion
 *           node,  high - low  should be greater than or equal to 2.
 *          with end recursion removal and sorting the smallest sublist
 *           first, our stack only needs room for log2 (N+1)/(M+2) nodes.
 *           a stack size of 24 can reliably handle almost 500 million lines.
 */
void quick_sort_block( long low, long high, line_list_ptr low_node,
                       line_list_ptr high_node )
{
long low_rline_stack[24];
long high_rline_stack[24];
line_list_ptr low_node_stack[24];
line_list_ptr high_node_stack[24];
long low_count;
long high_count;
long count;
line_list_ptr low_start;
line_list_ptr low_head;
line_list_ptr low_tail;
line_list_ptr high_end;
line_list_ptr high_head;
line_list_ptr high_tail;
line_list_ptr equal_head;
line_list_ptr equal_tail;
line_list_ptr walk_node;
line_list_ptr median_node;
int  i;
int  stack_pointer;

   assert( low_node->len != EOF);
   assert( high_node->len != EOF);

   stack_pointer = 0;
   for (;;) {

      /*
       * being that a median-of-three is used as the partition algorithm,
       *  we probably need to have at least 2 nodes in each sublist.  I
       *  chose a minimum of 25 nodes as a SWAG (scientific wild ass guess).
       *  a simple insertion sort mops the list after quicksort finishes.
       */
      while (high - low > 25) {

         assert( high >= 1 );
         assert( low  >= 1 );
         assert( low  <= high );

         /*
          * start the walk node at the head of the list and walk to the
          *  middle of the sublist.
          */
         walk_node  = low_node;
         count = (high - low) / 2;
         for (; count > 0; count--)
            walk_node = walk_node->next;

         /*
          * now, find the median of the low, middle, and high node.
          *
          * being that I am subject to error, let's assert that we really
          *  did find the median-of-three.
          */
         load_pivot( low_node );
         if (compare_pivot( walk_node ) < 0) {
            low_head   = walk_node;
            median_node = low_node;
         } else {
            low_head   = low_node;
            median_node = walk_node;
         }
         high_head = high_node;
         load_pivot( median_node );
         if (compare_pivot( high_node ) < 0) {
            high_head   = median_node;
            median_node = high_node;
         }
         load_pivot( median_node );
         if (compare_pivot( low_head ) > 0) {
            low_tail    = median_node;
            median_node = low_head;
            low_head    = low_tail;
         }

         load_pivot( median_node );

         assert( compare_pivot( low_head ) <= 0 );
         assert( compare_pivot( high_head ) >= 0 );

         /*
          * now, walk again from the head of the list comparing nodes and
          *  use the first occurrence of the median node as the partition.
          */
         walk_node = low_node;
         for (i = 0; ; walk_node = walk_node->next) {
            if (compare_pivot( walk_node ) == 0)
               break;
            i = 1;
         }

         /*
          * initialize pointers and counters for this partition.
          */
         low_start  = low_node->prev;
         high_end   = high_node->next;
         low_head   = low_tail  = NULL;
         high_head  = high_tail = NULL;
         low_count  = high_count = 0;

         /*
          * setup the first occurrence of the median node as a "fat pivot"
          *  sublist.  there are two cases to consider 1) the first
          *  occurrence of the median node is the first element in the
          *  sublist, i == 0, or 2) the first occurrence of the median node
          *  is somewhere in the sublist.
          */
         if (i == 0)
            walk_node = equal_head = equal_tail = low_node;
         else {
            equal_head = equal_tail = walk_node;
            equal_head->next->prev = equal_head->prev;
            equal_head->prev->next = equal_head->next;
            equal_head->next = low_node;
            walk_node = equal_head;
         }
         load_pivot( equal_head );

         /*
          * PARTITION:
          *  put all nodes less than the pivot on the end of the low list.
          *  put all nodes equal to the pivot on the end of the equal list.
          *  put all nodes greater than the pivot on the end of the high list.
          */
         for (count=low+1; count <= high; count++) {
            walk_node = walk_node->next;
            i = compare_pivot( walk_node );
            if (i > 0) {
               if (high_head == NULL)
                  high_head = high_tail = walk_node;
               else {
                  high_tail->next = walk_node;
                  walk_node->prev = high_tail;
                  high_tail = walk_node;
               }

               /*
                * keep a count of the number of nodes in the high list.
                */
               ++high_count;
            } else if (i < 0) {
               if (low_head == NULL)
                  low_head = low_tail = walk_node;
               else {
                  low_tail->next = walk_node;
                  walk_node->prev = low_tail;
                  low_tail = walk_node;
               }

               /*
                * keep a count of the number of nodes in the low list
                */
               ++low_count;
            } else {
               equal_tail->next = walk_node;
               walk_node->prev = equal_tail;
               equal_tail = walk_node;
            }
         }

         assert( low_count >= 0 );
         assert( low_count < high - low );
         assert( high_count >= 0 );
         assert( high_count < high - low );

         /*
          * we just partitioned the sublist into low, equal, and high
          *  sublists.  now, let's put the lists back together.
          */
         if (low_count > 0) {
            low_head->prev = low_start;
            if (low_start != NULL)
               low_start->next = low_head;
            else
               g_status.marked_file->line_list = low_head;
            low_tail->next = equal_head;
            equal_head->prev = low_tail;
         } else {
            equal_head->prev = low_start;
            if (low_start != NULL)
               low_start->next = equal_head;
            else
               g_status.marked_file->line_list = equal_head;
         }
         if (high_count > 0) {
            high_head->prev = equal_tail;
            equal_tail->next = high_head;
            high_tail->next = high_end;
            high_end->prev  = high_tail;
         } else {
            equal_tail->next = high_end;
            high_end->prev   = equal_tail;
         }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区欧美国产| 秋霞国产午夜精品免费视频| 欧美一区二区三区男人的天堂| 国产在线乱码一区二区三区| 亚洲一区免费在线观看| 欧美激情资源网| 欧美日韩高清一区二区三区| 成人精品小蝌蚪| 九色|91porny| 日韩激情一二三区| 亚洲精品乱码久久久久久黑人 | 欧美日韩aaa| caoporm超碰国产精品| 久久97超碰色| 青青草一区二区三区| 亚洲国产精品久久人人爱| 国产精品二三区| 中文字幕+乱码+中文字幕一区| 欧美大片免费久久精品三p | 91精品午夜视频| 欧美在线观看一二区| 99久久久精品| 国产98色在线|日韩| 久久99国产精品免费| 欧美aaa在线| 青椒成人免费视频| 日韩国产欧美在线播放| 丝袜美腿亚洲综合| 亚洲小少妇裸体bbw| 亚洲人成影院在线观看| 亚洲日本在线看| 欧美激情中文字幕| 久久久精品综合| 久久你懂得1024| 精品污污网站免费看| 一本到不卡精品视频在线观看| 不卡的电影网站| 99精品在线观看视频| 97精品视频在线观看自产线路二| 99视频一区二区三区| 91免费观看在线| 色婷婷激情一区二区三区| 91福利区一区二区三区| 91国产精品成人| 欧美日韩国产小视频在线观看| 欧美日韩一区久久| 日韩欧美亚洲国产精品字幕久久久| 欧美一级片在线| 久久免费精品国产久精品久久久久| 久久亚洲捆绑美女| 国产欧美一区二区在线观看| 久久精品无码一区二区三区| 国产精品国模大尺度视频| 亚洲免费资源在线播放| 偷拍自拍另类欧美| 久久er精品视频| 成人av在线一区二区三区| 色婷婷综合久久久久中文一区二区| 欧美性色黄大片| 日韩一区二区免费视频| 国产三级三级三级精品8ⅰ区| 国产精品久久久久天堂| 夜夜嗨av一区二区三区四季av| 亚洲天天做日日做天天谢日日欢| 亚洲在线免费播放| 男人的天堂亚洲一区| 国产伦精一区二区三区| 国产精品99久久久久| 国模大尺度一区二区三区| 国产精品正在播放| 91国产丝袜在线播放| 欧美tickling挠脚心丨vk| 国产精品国产馆在线真实露脸| 一区二区国产视频| 麻豆91精品91久久久的内涵| 国产成人免费网站| 欧美日本一区二区三区| 国产日本一区二区| 水野朝阳av一区二区三区| 国产风韵犹存在线视精品| 欧美三级在线播放| 国产日韩欧美电影| 亚洲一区二区三区四区的| 黄色资源网久久资源365| 不卡视频在线观看| 精品剧情v国产在线观看在线| 亚洲欧洲精品一区二区三区不卡 | 亚洲成国产人片在线观看| 精品一区二区综合| 在线精品视频一区二区| 日韩一区二区麻豆国产| 亚洲欧洲成人自拍| 精品综合免费视频观看| 欧美中文字幕一区| 中文字幕高清不卡| 免费在线看一区| 欧美在线你懂的| 国产精品久久夜| 激情久久五月天| 在线播放国产精品二区一二区四区| 中文字幕欧美日韩一区| 免费成人你懂的| 欧美影视一区二区三区| 国产精品视频一二三区| 久久疯狂做爰流白浆xx| 欧美日韩国产区一| 亚洲影院久久精品| 波波电影院一区二区三区| 久久久精品综合| 久久精品国产第一区二区三区| 欧美日韩国产乱码电影| 一区二区三区欧美日韩| fc2成人免费人成在线观看播放 | 国产一区二区三区精品欧美日韩一区二区三区 | 日韩一区二区三区高清免费看看 | 免费看日韩a级影片| 欧美午夜电影网| 亚洲精品日韩专区silk| a级精品国产片在线观看| 国产欧美一区二区精品秋霞影院 | 亚洲第一激情av| 在线观看免费亚洲| 中文字幕亚洲在| 成人av免费在线播放| 国产视频一区二区在线| 国产麻豆精品久久一二三| 2024国产精品| 国产精品18久久久久久久久| 久久亚洲一区二区三区四区| 国产一区二区精品在线观看| 2020国产精品久久精品美国| 精品在线播放免费| 久久久综合网站| 国产精品白丝jk黑袜喷水| 国产亚洲一二三区| 粉嫩av一区二区三区在线播放| 中文字幕精品三区| 不卡av在线网| 亚洲激情综合网| 欧美日韩成人综合| 日本va欧美va瓶| 久久久久久久久久久久久夜| 国产凹凸在线观看一区二区| 中文字幕av一区二区三区| 91同城在线观看| 亚洲国产一二三| 91精选在线观看| 国产一区二区三区精品视频| 国产欧美日韩综合| 91在线丨porny丨国产| 一区二区免费在线播放| 91精品国产一区二区三区| 麻豆精品视频在线| 国产视频一区在线播放| 一本色道久久综合狠狠躁的推荐| 一区二区三区 在线观看视频 | 久久久99精品免费观看| 成人一区二区三区| 国产精品久久久一区麻豆最新章节| 色综合一个色综合| 日韩av一区二区在线影视| 欧美精品一区二区久久久| 成人精品视频.| 亚洲成人免费观看| 26uuu国产一区二区三区| 成人免费视频国产在线观看| 亚洲最大的成人av| 欧美成人猛片aaaaaaa| 成人a免费在线看| 日日夜夜免费精品| 中文字幕第一区综合| 欧美日韩国产影片| 国产91对白在线观看九色| 亚洲一区欧美一区| 久久久久高清精品| 欧美日韩在线播放一区| 国产麻豆视频精品| 亚洲电影第三页| 国产色产综合色产在线视频| 精品视频在线看| 国产v综合v亚洲欧| 日本亚洲三级在线| 国产乱一区二区| 亚洲激情六月丁香| 欧美精品一区二区三区很污很色的 | 欧美亚洲一区二区在线观看| 久久er精品视频| 一区二区久久久久久| 久久久国产午夜精品| 欧美精品 日韩| 国产成人超碰人人澡人人澡| 亚洲综合一区二区| 久久久精品免费免费| 欧美日韩不卡一区| 91社区在线播放| 国产一区二区三区国产| 91精品中文字幕一区二区三区| 风间由美性色一区二区三区| 国产一区二区三区久久久| 亚洲欧洲国产日韩|