![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
文章平均质量分 77
qq_28528625
这个作者很懒,什么都没留下…
展开
-
排序
1.冒泡排序 //冒泡排序 for (int i = 0; i { for (int j = 0; j { if (adj[j, 2] > adj[j + 1, 2]) {原创 2017-12-20 20:50:35 · 114 阅读 · 0 评论 -
C#实现最小生成树
第一种: //求最小生成树,普里姆算法(Prim) //先给定一个初始点,然后找到离它最近的点,并加入找的点序列,将其对应的距离设为0 //然后找其它顶点距离新的找到点集合最小的点,再加入找到的点序列 //重复以上过程 public static void Prim_MiniTree(Graph g) { //存放找到的原创 2017-12-20 21:55:25 · 1222 阅读 · 0 评论 -
C#实现最短路径
1:迪杰斯特拉求最短路径 //迪杰斯特拉算法: /* 1.给定起点与终点,从起点开始找距离最小的点,再找距离找到点最小的(未找过的),直到找到终点 */ public static void Djstl(Graph g,int s,int e) { int[] l原创 2017-12-21 10:34:25 · 2817 阅读 · 0 评论 -
C#数据结构中的二叉树
class MyTree { public MyTree(char node) { Node = node; } public char Node; public MyTree lefttree; public MyTree righttree;原创 2017-12-14 19:36:27 · 225 阅读 · 0 评论 -
617. Merge Two Binary Trees
Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You need to merge them into a new binary tr转载 2017-12-16 18:23:32 · 88 阅读 · 0 评论 -
669. Trim a Binary Search Tree
Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might need to change the root of the tree, so the r转载 2017-12-16 20:04:00 · 106 阅读 · 0 评论 -
c#实现图
//先定义顶点信息,包括便签及访问记号 class Vertex { public string label; public bool visited; //构造函数用于初始化 public Vertex(string l) { this.label = l;原创 2017-12-19 14:42:47 · 622 阅读 · 0 评论