上一页 1 ··· 8 9 10 11 12 13 14 下一页
摘要: 7-1 最大子列和问题(20 分) 给定K个整数组成的序列{ N​1​​, N​2​​, ..., N​K​​ },“连续子列”被定义为{ N​i​​, N​i+1​​, ..., N​j​​ },其中 1≤i≤j≤K。“最大子列和”则被定义为所有连续子列元素的和中最大者。例如给定序列{ -2, 1 阅读全文
posted @ 2018-02-02 21:21 我只有一件白T恤 阅读(459) 评论(0) 推荐(0) 编辑
摘要: 6-12 二叉搜索树的操作集(30 分) 本题要求实现给定二叉搜索树的5种常用操作。 函数接口定义: BinTree Insert( BinTree BST, ElementType X ); BinTree Delete( BinTree BST, ElementType X ); Positio 阅读全文
posted @ 2018-02-01 21:05 我只有一件白T恤 阅读(526) 评论(0) 推荐(0) 编辑
摘要: 6-11 先序输出叶结点(15 分) 本题要求按照先序遍历的顺序输出给定二叉树的叶结点。 函数接口定义: void PreorderPrintLeaves( BinTree BT ); 其中BinTree结构定义如下: typedef struct TNode *Position; typedef 阅读全文
posted @ 2018-01-31 19:23 我只有一件白T恤 阅读(1365) 评论(0) 推荐(0) 编辑
摘要: 6-10 二分查找(20 分) 本题要求实现二分查找算法。 函数接口定义: Position BinarySearch( List Tbl, ElementType K ); 其中List结构定义如下: typedef int Position; typedef struct LNode *List 阅读全文
posted @ 2018-01-31 16:50 我只有一件白T恤 阅读(524) 评论(0) 推荐(0) 编辑
摘要: 6-9 二叉树的遍历(25 分) 本题要求给定二叉树的4种遍历。 函数接口定义: void InorderTraversal( BinTree BT ); void PreorderTraversal( BinTree BT ); void PostorderTraversal( BinTree B 阅读全文
posted @ 2018-01-31 15:52 我只有一件白T恤 阅读(1059) 评论(0) 推荐(0) 编辑
摘要: 6-8 求二叉树高度(20 分) 本题要求给定二叉树的高度。 函数接口定义: int GetHeight( BinTree BT ); 其中BinTree结构定义如下: typedef struct TNode *Position; typedef Position BinTree; struct 阅读全文
posted @ 2018-01-31 12:22 我只有一件白T恤 阅读(709) 评论(0) 推荐(0) 编辑
摘要: 6-7 在一个数组中实现两个堆栈(20 分) 本题要求在一个数组中实现两个堆栈。 函数接口定义: Stack CreateStack( int MaxSize ); bool Push( Stack S, ElementType X, int Tag ); ElementType Pop( Stac 阅读全文
posted @ 2018-01-30 22:43 我只有一件白T恤 阅读(5999) 评论(0) 推荐(0) 编辑
摘要: 6-6 带头结点的链式表操作集(20 分) 本题要求实现带头结点的链式表操作集。 函数接口定义: List MakeEmpty(); Position Find( List L, ElementType X ); bool Insert( List L, ElementType X, Positio 阅读全文
posted @ 2018-01-29 20:37 我只有一件白T恤 阅读(2528) 评论(0) 推荐(0) 编辑
摘要: 6-5 链式表操作集(20 分) 本题要求实现链式表的操作集。 函数接口定义: Position Find( List L, ElementType X ); List Insert( List L, ElementType X, Position P ); List Delete( List L, 阅读全文
posted @ 2018-01-28 21:30 我只有一件白T恤 阅读(530) 评论(0) 推荐(0) 编辑
摘要: 6-4 链式表的按序号查找(10 分) 本题要求实现一个函数,找到并返回链式表的第K个元素。 函数接口定义: ElementType FindKth( List L, int K ); 其中List结构定义如下: typedef struct LNode *PtrToLNode; struct LN 阅读全文
posted @ 2018-01-27 23:25 我只有一件白T恤 阅读(2007) 评论(2) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 下一页