• 大小:
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-22
  • 语言: C/C++
  • 标签: 算法  

资源简介

《数据结构与算法分析:C语言描述(第2版)》(附源码和答案)

资源截图

代码片段和文件信息

#include “aatree.h“
#include 
#include “fatal.h“

/* START: fig12_27.txt */
            /* Returned for failures */
        Position NullNode = NULL;  /* Needs more initialization */

        struct AANode
        {
            ElementType Element;
            AATree      Left;
            AATree      Right;
            int         Level;
        };

        AATree
        Initialize( void )
        {
            if( NullNode == NULL )
            {
                NullNode = malloc( sizeof( struct AANode ) );
                if( NullNode == NULL )
                    FatalError( “Out of space!!!“ );
                NullNode->Left = NullNode->Right = NullNode;
                NullNode->Level = 0;
            }
            return NullNode;
        }
/* END */

        AATree
        MakeEmpty( AATree T )
        {
            if( T != NullNode )
            {
                MakeEmpty( T->Left );
                MakeEmpty( T->Right );
                free( T );
            }
            return NullNode;
        }

        Position
        Find( ElementType X AATree T )
        {
            if( T == NullNode )
                return NullNode;
            if( X < T->Element )
                return Find( X T->Left );
            else
            if( X > T->Element )
                return Find( X T->Right );
            else
                return T;
        }

        Position
        FindMin( AATree T )
        {
            if( T == NullNode )
                return NullNode;
            else
            if( T->Left == NullNode )
                return T;
            else
                return FindMin( T->Left );
        }

        Position
        FindMax( AATree T )
        {
            if( T != NullNode )
                while( T->Right != NullNode )
                    T = T->Right;

            return T;
        }

        /* This function can be called only if K2 has a left child */
        /* Perform a rotate between a node (K2) and its left child */
        /* Update heights then return new root */

        static Position
        SingleRotateWithLeft( Position K2 )
        {
            Position K1;

            K1 = K2->Left;
            K2->Left = K1->Right;
            K1->Right = K2;

            return K1;  /* New root */
        }

        /* This function can be called only if K1 has a right child */
        /* Perform a rotate between a node (K1) and its right child */
        /* Update heights then return new root */

        static Position
        SingleRotateWithRight( Position K1 )
        {
            Position K2;

            K2 = K1->Right;
            K1->Right = K2->Left;
            K2->Left = K1;

            return K2;  /* New root */
        }

/* START: fig12_29.txt */
        /* If T‘s left child is on the same level as T */
        /* perform a rotation */

        AATree
        Skew( AATree T )
        {
            if( T->Left->Level == T->Level )
                T = SingleRotateWithLeft( T

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件           0  2017-11-22 17:30  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?
     目录           0  2014-09-11 10:22  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?涔犻绛旀\
     文件        4112  2014-09-04 22:11  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?涔犻绛旀\ch00.pdf
     文件       11708  2014-09-04 22:11  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?涔犻绛旀\ch01.pdf
     文件       14778  2014-09-04 22:11  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?涔犻绛旀\ch02.pdf
     文件       15330  2014-09-04 22:11  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?涔犻绛旀\ch03.pdf
     文件       29060  2014-09-04 22:11  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?涔犻绛旀\ch04.pdf
     文件       13390  2014-09-04 22:11  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?涔犻绛旀\ch05.pdf
     文件       32039  2014-09-04 22:11  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?涔犻绛旀\ch06.pdf
     文件       22231  2014-09-04 22:11  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?涔犻绛旀\ch07.pdf
     文件       14724  2014-09-04 22:11  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?涔犻绛旀\ch08.pdf
     文件       42865  2014-09-04 22:11  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?涔犻绛旀\ch09.pdf
     文件       45488  2014-09-04 22:11  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?涔犻绛旀\ch10.pdf
     文件       13333  2014-09-04 22:11  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?涔犻绛旀\ch11.pdf
     文件        4435  2014-09-04 22:11  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?涔犻绛旀\ch12.pdf
     文件    40795325  2014-09-04 22:11  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?鏁版嵁缁撴瀯涓庣畻娉曞垎鏋愶細C璇█鎻忚堪锛堢2鐗堬級.pdf
     目录           0  2015-01-15 09:15  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?婧愮爜\
     文件        6181  2015-01-15 09:14  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?婧愮爜\aatree.c
     文件         669  2015-01-15 09:14  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?婧愮爜\aatree.h
     文件        5593  2015-01-15 09:14  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?婧愮爜\avltree.c
     文件         583  2015-01-15 09:14  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?婧愮爜\avltree.h
     文件        3364  2015-01-15 09:14  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?婧愮爜\binheap.c
     文件         588  2015-01-15 09:14  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?婧愮爜\binheap.h
     文件        6727  2015-01-15 09:14  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?婧愮爜\binomial.c
     文件         762  2015-01-15 09:14  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?婧愮爜\binomial.h
     文件        4474  2015-01-15 09:14  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?婧愮爜\cursor.c
     文件         890  2015-01-15 09:14  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?婧愮爜\cursor.h
     文件        2564  2015-01-15 09:14  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?婧愮爜\disjsets.c
     文件        4737  2015-01-15 09:14  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?婧愮爜\dsl.c
     文件         701  2015-01-15 09:14  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?婧愮爜\dsl.h
     文件         156  2015-01-15 09:14  銆婃暟鎹粨鏋勪笌绠楁硶鍒嗘瀽锛欳璇█鎻忚堪锛堢2鐗堬級銆嬶紙闄勬簮鐮佸拰绛旀锛?婧愮爜\fatal.h
............此处省略61个文件信息

评论

共有 条评论