算法与最优化

二叉搜索树的操作集

二叉搜索树的操作集 本题要求实现给定二叉搜索树的5种常用操作 函数接口定义 BinTree Insert( BinTree BST, ElementType X ); BinTree Delete( BinTree BST, ElementType X ); Position F

2022-04-22· 3 min · 538 字
算法与最优化

二分查找

二分查找 本题要求实现二分查找算法。 函数接口定义 Position BinarySearch( List L, ElementType X ); 其中List结构定义如下: typedef int Position; typedef struct LNode *List; st

2022-04-20· 2 min · 228 字
算法与最优化

二叉树的遍历

二叉树的遍历 本题要求给定二叉树的4种遍历 函数接口定义 void InorderTraversal( BinTree BT ); void PreorderTraversal( BinTree BT ); void PostorderTraversal( BinTree BT

2022-04-20· 2 min · 343 字
算法与最优化

在一个数组中实现两个堆栈

在一个数组中实现两个堆栈 本题要求在数组中实现两个堆栈 函数接口定义 Stack CreateStack( int MaxSize ); bool Push( Stack S, ElementType X, int Tag ); ElementType Pop( Stack S,

2022-04-19· 2 min · 416 字
算法与最优化

带头结点的链式表操作集

带头结点的链式表操作集 本题要求实现带头结点的链式表操作集 函数接口定义 Position Find( List L, ElementType X ); List Insert( List L, ElementType X, Position P ); List Delete(

2022-04-16· 3 min · 475 字
算法与最优化

链式表操作集

链式表操作集 本题要求实现链式表的操作集 函数接口定义 Position Find( List L, ElementType X ); List Insert( List L, ElementType X, Position P ); List Delete( List L, P

2022-04-16· 3 min · 541 字
算法与最优化

链式表的按序号查找

链式表的按序号查找 本题要求实现一个函数,找到并返回链式表的第K个元素、 函数接口定义 ElementType FindKth( List L, int K ); 其中List结构定义如下: typedef struct LNode *PtrToLNode; struct LNo

2022-04-15· 1 min · 180 字
算法与最优化

求链式表的表长

求链式表的表长 本题要求实现一个函数,求链式表的表厂。 函数式接口定义 int Length( List L ); 其中List结构定义如下: typedef struct LNode *PtrToLNode; struct LNode { ElementType Data; P

2022-04-15· 1 min · 114 字
算法与最优化

顺序表操作集

顺序表操作集 本题要求实现顺序表的操作集 函数接口定义 List MakeEmpty(); Position Find( List L, ElementType X ); bool Insert( List L, ElementType X, Position P ); bool

2022-04-15· 3 min · 475 字
算法与最优化

逆转链表

单链表逆转 本题要求实现一个函数,将给定的单链表逆转 函数接口定义 List Reverse(List L); 其中List结构定义如下: typedef struct Node PtrToNode; struct Node{ ElementType Data; / 存储结点

2022-04-15· 1 min · 133 字
算法与最优化

AvlTree

#include<stdio.h> #include<malloc.h> #include<stdlib.h> struct AvlNode; typedef struct AvlNode *Position; typedef struct A

2022-04-10· 4 min · 673 字
算法与最优化

二叉搜索树实现

BinarySearchTree #include<stdlib.h> #include<malloc.h> #include<stdio.h> struct TreeNode; typedef struct TreeNode *Positio

2022-04-01· 2 min · 371 字