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

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

?? ahuff.c

?? huffman coding and decoding adaptive huffman coding and decoding it is a assignment from my cours
?? C
?? 第 1 頁 / 共 3 頁
字號:
 * called recursively.  It starts off with a starting guess for where * we want the node to go, and returns the actual result, which is * the column the node ended up in.  For example, I might want my node * to print in column 0.  After recursively evaluating everything under * the node, I may have been pushed over to node -10 ( the tree is * evaluated down the right side first ).  I return that to whoever called * this routine so it can use the nodes position to calculate where * the node in a higher row is to be placed. */int calculate_columns( tree, node, starting_guess )TREE *tree;int node;int starting_guess;{    int next_node;    int right_side;    int left_side;/* * The first thing I check is to see if the node on my immediate right has * already been placed.  If it has, I need to make sure that I am at least * 4 columns to the right of it.  This allows me to print 3 characters plus * leave a blank space between us. */    next_node = positions[ node ].next_member;    if ( next_node != -1 ) {        if ( positions[ next_node ].column < ( starting_guess + 4 ) )            starting_guess = positions[ next_node ].column - 4;    }    if ( tree->nodes[ node ].child_is_leaf ) {        positions[ node ].column = starting_guess;        return( starting_guess );    }/* * After I have adjusted my starting guess, I calculate the actual position * of the right subtree of this node.  I pass it a guess for a starting * node based on my starting guess.  Naturally, what comes back may be * moved over quite a bit. */    right_side = calculate_columns( tree, tree->nodes[ node ].child, starting_guess + 2 );/* * After figuring out where the right side lands, I do the same for the * left side.  After doing the right side, I have a pretty good guess where * the starting column for the left side might go, so I can pass it a good * guess for a starting column. */    left_side = calculate_columns( tree, tree->nodes[ node ].child + 1, right_side - 4 );/* * Once I know where the starting column for the left and right subtrees * are going to be for sure, I know where this node should go, which is * right in the middle between the two.  I calcluate the column, store it, * then return the result to whoever called me. */    starting_guess = ( right_side + left_side ) / 2;    positions[ node ].column = starting_guess;    return( starting_guess );}int find_minimum_column( tree, node, max_row )TREE *tree;int node;int max_row;{    int min_right;    int min_left;    if ( tree->nodes[ node ].child_is_leaf || max_row == 0 )        return( positions[ node ].column );    max_row--;    min_right = find_minimum_column( tree, tree->nodes[ node ].child + 1, max_row );    min_left = find_minimum_column( tree, tree->nodes[ node ].child, max_row );    if ( min_right < min_left )        return( min_right );    else        return( min_left );}/* * Once the columns of each node have been calculated, I go back and rescale * the columns to be actual printer columns.  In this particular program, * each node takes three characters to print, plus one space to keep nodes * separate.  We take advantage of the fact that every node has at least one * logical column between it and the ajacent node, meaning that we can space * nodes only two physical columns apart.  The spacing here consists of * rescaling each column so that the smallest column is at zero, then * multiplying by two to get a physical printer column. */void rescale_columns( factor )int factor;{    int i;    int node;/* * Once min is known, we can rescale the tree so that column min is * pushed over to column 0, and each logical column is set to be two * physical columns on the printer. */    for ( i = 0 ; i < 30 ; i++ ) {        if ( rows[ i ].first_member == -1 )            break;        node = rows[ i ].first_member;        do {            positions[ node ].column -= factor;            node = positions[ node ].next_member;        } while ( node != -1 );    }}/* * print_tree is called after the row and column of each node have been * calculated.  It just calls the four workhorse routines that are * responsible for printing out the four elements that go on each row. * At the top of the row are the connecting lines hooking the tree * together.  On the next line of the row are the node numbers.  Below * them are the weights, and finally the symbol, if there is one. */void print_tree( tree, first_row, last_row )TREE *tree;int first_row;int last_row;{    int row;    for ( row = first_row ; row <= last_row ; row++ ) {        if ( rows[ row ].first_member == -1 )            break;        if ( row > first_row )            print_connecting_lines( tree, row );        print_node_numbers( row );        print_weights( tree, row );        print_symbol( tree, row );    }}/* * Printing the connecting lines means connecting each pair of nodes. * I use the IBM PC character set here.  They can easily be replaced * with more standard alphanumerics. */#ifndef ALPHANUMERIC#define LEFT_END  218#define RIGHT_END 191#define CENTER    193#define LINE      196#define VERTICAL  179#else#define LEFT_END  '+'#define RIGHT_END '+'#define CENTER    '+'#define LINE      '-'#define VERTICAL  '|'#endifvoid print_connecting_lines( tree, row )TREE *tree;int row;{    int current_col;    int start_col;    int end_col;    int center_col;    int node;    int parent;    current_col = 0;    node = rows[ row ].first_member;    while ( node != -1 ) {        start_col = positions[ node ].column + 2;        node = positions[ node ].next_member;        end_col = positions[ node ].column + 2;        parent = tree->nodes[ node ].parent;        center_col = positions[ parent ].column;        center_col += 2;        for ( ; current_col < start_col ; current_col++ )            putc( ' ', stdout );        putc( LEFT_END, stdout );        for ( current_col++ ; current_col < center_col ; current_col++ )            putc( LINE, stdout );        putc( CENTER, stdout );        for ( current_col++; current_col < end_col ; current_col++ )            putc( LINE, stdout );        putc( RIGHT_END, stdout );        current_col++;        node = positions[ node ].next_member;    }    printf( "\n" );}/* * Printing the node numbers is pretty easy. */void print_node_numbers( row )int row;{    int current_col;    int node;    int print_col;    current_col = 0;    node = rows[ row ].first_member;    while ( node != -1 ) {        print_col = positions[ node ].column + 1;        for ( ; current_col < print_col ; current_col++ )            putc( ' ', stdout );        printf( "%03d", node );        current_col += 3;        node = positions[ node ].next_member;    }    printf( "\n" );}/* * Printing the weight of each node is easy too. */void print_weights( tree, row )TREE *tree;int row;{    int current_col;    int print_col;    int node;    int print_size;    int next_col;    char buffer[ 10 ];    current_col = 0;    node = rows[ row ].first_member;    while ( node != -1 ) {        print_col = positions[ node ].column + 1;        sprintf( buffer, "%u", tree->nodes[ node ].weight );        if ( strlen( buffer ) < 3 )            sprintf( buffer, "%03u", tree->nodes[ node ].weight );        print_size = 3;        if ( strlen( buffer ) > 3 ) {            if ( positions[ node ].next_member == -1 )                print_size = strlen( buffer );            else {                next_col = positions[ positions[ node ].next_member ].column;                if ( ( next_col - print_col ) > 6 )                    print_size = strlen( buffer );                else {                    strcpy( buffer, "---" );                    print_size = 3;                }            }        }        for ( ; current_col < print_col ; current_col++ )            putc( ' ', stdout );        printf( buffer );        current_col += print_size;        node = positions[ node ].next_member;    }    printf( "\n" );}/* * Printing the symbol values is a little more complicated.  If it is a * printable symbol, I print it between simple quote characters.  If * it isn't printable, I print a hex value, which also only takes up three * characters.  If it is an internal node, it doesn't have a symbol, * which means I just print the vertical line.  There is one complication * in this routine.  In order to save space, I check first to see if * any of the nodes in this row have a symbol.  If none of them have * symbols, we just skip this part, since we don't have to print the * row at all. */void print_symbol( tree, row )TREE *tree;int row;{    int current_col;    int print_col;    int node;    current_col = 0;    node = rows[ row ].first_member;    while ( node != -1 ) {        if ( tree->nodes[ node ].child_is_leaf )            break;        node = positions[ node ].next_member;    }    if ( node == -1 )        return;    node = rows[ row ].first_member;    while ( node != -1 ) {        print_col = positions[ node ].column + 1;        for ( ; current_col < print_col ; current_col++ )            putc( ' ', stdout );        if ( tree->nodes[ node ].child_is_leaf ) {            if ( isprint( tree->nodes[ node ].child ) )                printf( "'%c'", tree->nodes[ node ].child );            else if ( tree->nodes[ node ].child == END_OF_STREAM )                printf( "EOF" );            else if ( tree->nodes[ node ].child == ESCAPE )                printf( "ESC" );            else                printf( "%02XH", tree->nodes[ node ].child );        } else            printf( " %c ", VERTICAL );        current_col += 3;        node = positions[ node ].next_member;    }    printf( "\n" );}/************************** End of AHUFF.C ****************************/

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久久久久久电影| 蜜桃在线一区二区三区| 免费成人美女在线观看| 不卡视频在线看| 欧美mv日韩mv| 首页国产欧美久久| 色哟哟一区二区| 国产精品美女一区二区三区| 国产一区激情在线| 欧美一区二区三区四区视频| 一区二区成人在线视频| 91在线porny国产在线看| 久久久午夜电影| 另类小说综合欧美亚洲| 欧美日韩mp4| 午夜影院久久久| 欧洲在线/亚洲| 亚洲综合色成人| 在线观看av一区二区| 亚洲精品va在线观看| 处破女av一区二区| 欧美国产成人精品| 国产成人免费视频精品含羞草妖精| 日韩午夜精品视频| 美女爽到高潮91| 日韩亚洲欧美中文三级| 久久er99精品| 久久久久久麻豆| 国产精品中文字幕日韩精品| 欧美激情在线一区二区三区| 国产精品一区二区黑丝| 国产清纯美女被跳蛋高潮一区二区久久w | 五月婷婷综合网| 欧美性猛片aaaaaaa做受| 亚洲成在线观看| 91精品在线免费观看| 美女一区二区视频| 亚洲精品一区二区三区蜜桃下载| 精品午夜久久福利影院| 国产亚洲精品aa午夜观看| 国产成人精品免费网站| 国产精品久久久久aaaa樱花 | 国产精品毛片久久久久久| 不卡的电视剧免费网站有什么| 国产精品国产三级国产专播品爱网| 成人高清视频在线| 亚洲精品高清在线观看| 欧美久久久影院| 久久国产尿小便嘘嘘| 中文字幕+乱码+中文字幕一区| 99re热这里只有精品视频| 亚洲国产精品一区二区尤物区| 欧美狂野另类xxxxoooo| 国内精品在线播放| 亚洲三级电影网站| 欧美久久久久免费| 国产高清不卡一区| 一区二区三区精品视频在线| 欧美一区日韩一区| 成人激情午夜影院| 日韩专区中文字幕一区二区| 久久视频一区二区| 在线观看免费亚洲| 国产一区二区三区免费播放| 亚洲免费av网站| 精品国产乱码久久久久久闺蜜| 成人黄页毛片网站| 丝袜国产日韩另类美女| 国产精品日日摸夜夜摸av| 欧美人牲a欧美精品| 国产精品亚洲午夜一区二区三区 | 综合欧美亚洲日本| 日韩一级免费观看| 欧洲av一区二区嗯嗯嗯啊| 精品亚洲成a人| 亚洲在线中文字幕| 国产欧美综合色| 日韩一区二区精品在线观看| 9色porny自拍视频一区二区| 日本在线不卡视频一二三区| 亚洲精品乱码久久久久久久久 | 制服丝袜亚洲网站| 成人aa视频在线观看| 美女一区二区久久| 五月激情六月综合| 一区二区视频免费在线观看| 久久毛片高清国产| 国产精品国产精品国产专区不蜜| 51精品视频一区二区三区| 97久久精品人人澡人人爽| 国产一区二区三区美女| 七七婷婷婷婷精品国产| 亚洲无人区一区| 日韩毛片在线免费观看| xf在线a精品一区二区视频网站| 欧美三级在线播放| 91精品福利在线| 日本高清不卡视频| 97国产一区二区| 成人蜜臀av电影| 丁香婷婷综合网| 国产福利电影一区二区三区| 久久99这里只有精品| 麻豆国产精品官网| 精品一区二区三区欧美| 久久成人综合网| 国产在线精品一区二区夜色| 久久99精品国产| 极品少妇一区二区| 精品亚洲成a人在线观看| 九九热在线视频观看这里只有精品| 午夜精品视频在线观看| 日本伊人色综合网| 美国欧美日韩国产在线播放| 久久精品国产免费| 国产在线不卡一卡二卡三卡四卡| 久久激情五月激情| 国产精品综合网| 国产精品一区二区在线看| 成人一二三区视频| 97se亚洲国产综合自在线不卡| 91在线观看成人| 欧美日韩国产天堂| 欧美一区二区免费视频| 精品999久久久| 国产精品久久久久影院| 一区二区三区在线观看视频| 亚洲国产中文字幕| 蜜桃视频第一区免费观看| 国产米奇在线777精品观看| 丁香一区二区三区| 欧美色涩在线第一页| 欧美一级二级三级蜜桃| 亚洲国产精品t66y| 一区二区三区在线高清| 日本欧美一区二区三区乱码| 国产麻豆精品在线观看| 色视频一区二区| 制服丝袜亚洲精品中文字幕| 国产丝袜美腿一区二区三区| 亚洲精品国产无天堂网2021| 奇米一区二区三区av| 懂色av一区二区在线播放| 欧美在线视频日韩| 精品久久久久久久久久久久久久久 | 狠狠色狠狠色综合| 99精品视频在线播放观看| 欧美日韩一区国产| 久久久久久免费网| 亚洲国产精品尤物yw在线观看| 国产一区三区三区| 欧美性猛交一区二区三区精品| 精品国产伦一区二区三区观看体验 | 亚洲一区成人在线| 国产真实乱偷精品视频免| 一本色道久久综合亚洲91| 欧美变态tickle挠乳网站| 亚洲成人av一区二区三区| 国产精品一卡二卡| 欧美久久久久久久久中文字幕| 国产免费成人在线视频| 奇米综合一区二区三区精品视频| www..com久久爱| 久久亚洲欧美国产精品乐播| 亚洲国产精品久久人人爱蜜臀 | 国产女主播一区| 日韩国产高清影视| 色琪琪一区二区三区亚洲区| 久久人人爽人人爽| 日本中文字幕一区二区有限公司| 99精品久久只有精品| 久久久三级国产网站| 免费在线观看成人| 欧美理论电影在线| 亚洲一区在线播放| 99久久99久久久精品齐齐| 国产亚洲欧洲一区高清在线观看| 亚洲成av人在线观看| 91在线免费看| 中文字幕av一区二区三区免费看| 理论电影国产精品| 91精品黄色片免费大全| 午夜a成v人精品| 欧美在线观看18| 一二三区精品福利视频| 91视频免费播放| 亚洲欧洲精品成人久久奇米网| 国产精品 日产精品 欧美精品| 欧美一区二区三区四区五区| 日欧美一区二区| 欧美精品一二三四| 日本欧美在线观看| 日韩一级黄色片| 韩国成人在线视频| 久久只精品国产| 国产乱人伦偷精品视频免下载| 26uuu欧美| 高清国产午夜精品久久久久久| 久久精品一区二区三区不卡牛牛 | 国产精品伦一区|