二叉排序树(BST) 二叉排序树,又称二叉查找树(BST) 左子树结点值<根节点值<右子树结点值 如果用中序遍历来遍历一棵二叉排序树的话,可以得到一个递增的有序数列 左根右 二叉排序树的查找 //二叉排序树结点 typedef struct BSTNode{ int key; struct BSTN ...
分类:
编程语言 时间:
2020-06-28 13:17:50
阅读次数:
111
树——存储结构 双亲表示法(顺序存储) 双亲表示法:每个节点中保存指向双亲的“指针” #define MAX_TREE_SIZE 100 //树中最多的结点数 typedef struct{ //树的结点定义 ElemType data; //数据元素 int parent; //双亲位置域 }PT ...
分类:
其他好文 时间:
2020-06-28 13:06:22
阅读次数:
76
题目链接 对于每一个 \(i\) 可以看作一个管道。赋予三个信息: \(\text{minIn}_i\) 表示至少要从上一家 \(i - 1\) 得到连接数,才能正常供给 \(i\) 城市 \(\text{minOut}_i\) 最坏情况下最少给下一家 \(i + 1\) 多少连接数 \(\text ...
分类:
Web程序 时间:
2020-06-28 00:30:11
阅读次数:
76
给定一个整数 n,生成所有由 1 ... n 为节点所组成的 二叉搜索树 。 输入:3 输出: [ [1,null,3,2], [3,2,null,1], [3,1,null,null,2], [2,1,3], [1,null,2,null,3] ] 解释: 以上的输出对应以下 5 种不同结构的二叉 ...
分类:
其他好文 时间:
2020-06-27 20:32:43
阅读次数:
68
/*增设tag数据,区分队满队空*/ #include<stdio.h> #define MaxSize 10 typedef char ElemType; typedef struct { ElemType data[MaxSize]; int front,rear,tag; }SqQueue; ...
分类:
其他好文 时间:
2020-06-27 20:16:37
阅读次数:
60
/*增设表示元素个数的数据*/ #include<stdio.h> #define MaxSize 10 typedef char ElemType; typedef struct { ElemType data[MaxSize]; int front,rear; int size; }SqQueu ...
分类:
其他好文 时间:
2020-06-27 19:54:01
阅读次数:
66
一直不明白什么时候应用指令。 一个开源项目中的指令应用场景。 头部右上角有登陆信息,用户登陆后和未登录的情况,menu列表不同。 <!-- Show this for logged out users --> <ul *appShowAuthed="false" class="nav navbar- ...
分类:
其他好文 时间:
2020-06-27 15:54:11
阅读次数:
107
一、线性表的查找 1、顺序查找: typedef KeyType int;//这个根据具体情况去定义;在这里定义为int; typedef struct{ KeyType key; InfoType otherinfo;//这个根据具体情况去改,这里只是抽象的说成还要添加这些类型。 }ElemTyp ...
分类:
其他好文 时间:
2020-06-27 13:29:49
阅读次数:
62
Pop Sequence:: Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You are supposed to te ...
分类:
其他好文 时间:
2020-06-27 13:25:15
阅读次数:
53
题目 https://www.luogu.com.cn/problem/P4913 代码 #include<iostream> #include<cstdio> struct node { int left; int right; }list[1000001]; int depth = 0; voi ...
分类:
其他好文 时间:
2020-06-27 13:11:54
阅读次数:
75