随笔分类 - 数据结构
摘要:https://www.yuque.com/u1850273/xk1y9a/hglh68
阅读全文
摘要://数组反转 #include <iostream> #include<array> using namespace std; int main() { int i; array <int,7> a={1,2,3,4,5,6,7}; array <int,7> b; b=a;//备份数组a for(
阅读全文
摘要:###数据结构 | 二叉树 ####二叉树性质 第i层至多有2^(i-1)个结点 深度为k,总共2^k-1个结点 由n=n0+n1+n2,n=n1+2*n2+1联立,n2+1=n0 n个结点的二叉树深度为log2(n)向下取整+1 i=1,为根结点,i>1,i/2(C语言整数除法)为双亲 2*i 2
阅读全文
摘要:顺序存储的树定义 #define MAX_TREE_SIZE 100 //顺序表的树对应的节点个数上限 typedef char Elemtype; typedef struct PTNode //第一个标签可以省略(PTNode)可省 { Elemtype data;//每个节点得数据类型定义 i
阅读全文