![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
树
tara_int
我的程序成长史。
展开
-
堆排序 数据结构实验之排序四:寻找大富翁
#include<stdio.h> #define INF 0x3f3f3f3f int n, m, a[15]; int size; int delete_max()//和插入思路很像,找到儿子比自己大的放在自己的位置,自己继续往下找,直到儿子都比自己小的时候,自己就坐定了 { int p, c, max, t; max = a[1]; //大顶堆,...翻译 2018-08-22 16:13:05 · 156 阅读 · 0 评论 -
最小生成树 oj 2144
n个点,有n-1条边就可连通, 总花费最小要选择 花费小 且 不会使各点连环 的 n-1条边 快排对边长(费用)进行排序, merge函数中判断会不会成环, 边数达到n-1 break; #include <stdio.h> #include <stdlib.h> int m, n, f[110]; struct node { int u, v, w; }a[...原创 2018-08-23 21:16:25 · 553 阅读 · 0 评论