![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
清沐_1412
这个作者很懒,什么都没留下…
展开
-
链表的基本操作
链表的基本操作:(不介绍,直接上代码) 先看一下最终界面: 代码:#include<stdio.h> #include<stdlib.h> #include<time.h>typedef int ElemType; typedef struct Node{ ElemType data; struct Node *next; }Node, *LinkList; void InitL原创 2015-10-28 22:11:14 · 668 阅读 · 1 评论 -
c++实现基本循环队列操作
在慕课网上学习的c++循环队列,自己也写了个实现代码。头文件:#ifndef MYQUEUE_H #define MYQUEUE_Hclass MyQueue{ public: MyQueue(int queueCapacity); //InitQueue(&q) 创建队列 virtual ~MyQueue(); //DestroyQueue(&原创 2017-06-19 15:37:24 · 860 阅读 · 0 评论 -
c++实现基本栈造作
c++实现基本栈操作:后进先出头文件:(注意是ifndef)#ifndef MYSTACK_H #define MYSTACK_Hclass MyStack{ public: MyStack(int size); //分配内存初始化栈空间,设定栈容量,栈顶 ~MyStack(); //回收空间 bool stackFull(); //判定栈满 bo原创 2017-06-19 17:11:52 · 332 阅读 · 0 评论 -
C++实现顺序表的基本操作
头文件:#ifndef List_H #define List_Htypedef int Elem; class List{ public: List(int size); //初始化顺序表 ~List(); //销毁表,析构函数 bool isEmpty(); //是否为空 i原创 2017-06-20 18:19:20 · 2249 阅读 · 0 评论 -
c++实现链表的基本操作
头文件:(新加结点类)#ifndef LIST_H #define LIST_Hclass Node{ public: int data; Node *next; void printNode(); };class List{ public: List(); ~List(); void clearList(); bool isEmpty();原创 2017-06-22 23:43:15 · 432 阅读 · 0 评论 -
二叉树的基本操作——java实现
树 的数据结构 public class TreeNode { private int data; private TreeNode LeftNode; private TreeNode RightNode; public TreeNode() { // TODO Auto-generated constructor stub } ...转载 2018-08-20 22:46:51 · 435 阅读 · 0 评论 -
二叉树层次遍历并打印行号——java
主要代码 public void levelOrderNew(TreeNode root) { TreeNode last=root; //当前行最右结点 TreeNode nlast = null; //下一行最右结点 TreeNode temp; Queue<TreeNode> queue=new Linked...原创 2018-08-20 22:58:55 · 877 阅读 · 0 评论