![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
文章平均质量分 67
W...Z
这个作者很懒,什么都没留下…
展开
-
c++ 双向链表
#include <iostream>using std::cout;using std::endl;struct Node{ int data; struct Node * next; struct Node * pre;};一、创建双向链表Node * createList(){ Node * head = new Node; if (NULL == ...原创 2019-01-20 13:14:06 · 1042 阅读 · 1 评论 -
c++单向链表
#include <iostream>#include <time.h>using std::cout;using std::endl;struct Node{ int data; struct Node* next;};一、创建链表Node * createList(){ Node *head = new Node; if (NULL == h...原创 2019-01-06 15:19:41 · 659 阅读 · 1 评论 -
二叉树浅析
二叉树是一种比较有用的折中方案。数组的搜索比较方便 ,直接使用下标,可是删除和插入元素比较麻烦。链表与之相反,删除和插入很快,但是查找很慢。性质性质1:二叉树第i层上的结点数目最多为 2^(i-1) 。性质2:深度为k的二叉树至多有2^k-1个结点(k≥1)。性质3:包含n个结点的二叉树的高度至少为log2 (n+1)。性质4:在任意一棵二叉树中,若终端结点的个数为n0,度为2的结点数为n2,则n0=n2+1。.满二叉树如果二叉树中除了叶子结点,每个结点的度都为 2完全二叉树设二原创 2022-02-12 15:23:44 · 520 阅读 · 0 评论