![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT
LeviKing98
这个作者很懒,什么都没留下…
展开
-
Dijkstra算法模板
Dijkstra求最短路径模板原创 2022-01-16 22:57:07 · 616 阅读 · 0 评论 -
小顶堆计算最小带权路径
#include <iostream> #include <algorithm> using namespace std; const int maxn=30; int n; int heap[maxn]; void downAdjust(int low,int high){ int i=low,j=i*2; while(j<=high){ if(j+1<=high && heap[j]>heap[j+1]) j=j+1; if(原创 2022-01-14 16:48:11 · 214 阅读 · 0 评论 -
堆及堆排序的基本操作
#include <iostream> #include <algorithm> using namespace std; const int maxn=100; int heap[maxn],n=10; void downAdjust(int low,int high){//向下调整大顶堆 int i=low,j=i*2; while(j<=high)//存在孩子节点 { if(j+1<=high&&heap[j+1]>heap[j]原创 2022-01-14 13:59:55 · 199 阅读 · 0 评论 -
平衡二叉查找树的基本操作
#include <iostream> #include <algorithm> using namespace std; const int maxn=10000; struct Node{ int data,height; Node* lchild; Node* rchild; }; Node* newNode(int data){//创建新节点 Node* root=new Node; root->data=data; root->height=原创 2022-01-13 22:10:22 · 108 阅读 · 0 评论 -
二叉查找树(BST)的基本操作
#include <iostream> const int maxn=1000; int N; int seq[maxn]; struct Node{ int data; Node* lchild; Node* rchild; }; Node* newNode(int v){//建立新节点 Node* node=new Node; node->data=v; node->lchild=node->rchild=NULL; return node; } vo原创 2022-01-13 20:22:28 · 179 阅读 · 0 评论 -
重建二叉树(先序与中序、后序与中序)
重建二叉树(先序与中序、后序与中序)原创 2022-01-12 22:05:44 · 293 阅读 · 0 评论