![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
南邮数据结构实验
cute_young
这个作者很懒,什么都没留下…
展开
-
二叉树基本操作及层次遍历
#include #include using namespace std;typedef struct Node{ Node *lchild; Node *rchild; int data;}Node;int hcount=1,height=1,leaf=0;//height是树的高度,leaf是叶子结点数void deletetree(No原创 2015-11-02 17:05:08 · 357 阅读 · 0 评论 -
图的基本操作及BFS与DFS的实现以及飞机换乘问题
运用STL中的queue队列实现BFS。#include#include#includeusing namespace std;enum ResultCode { Underflow, Duplicate, Failure, Success, NotPresent };templateclass Graph{public: virtual ResultCode Insert(原创 2015-12-16 23:23:43 · 597 阅读 · 0 评论 -
各种内排序算法的实现及性能比较
主要都是教材上的代码,只是用到了time.h库函数以及其中的clock_t类#include#include#includeusing namespace std;templatevoid Swap(T &a,T &b){ T temp=a; a=b; b=temp;}templatevoid SelectSort(T A[],int n) //简单选择排序{ i原创 2015-12-23 16:22:54 · 1747 阅读 · 1 评论