随笔分类 - 数据结构
摘要:1、设计节点: 2.初始化队列 3、判断队列是否为空 4、入队操作 5、出队操作 6、队列的遍历 7、队列的销毁 完整代码: typedef struct Node{int data;struct Node *next;}Node,*Queue;typedef struct{Queue front;
阅读全文
摘要:#include<stdlib.h>#include<stdio.h>#include<malloc.h>#include<kernel_list.h>typedef struct node{ int data; struct list_head list;}listnode,*linklist;
阅读全文
摘要:顺序表: 声明:struct seqlist { Int last; Int data[12]; }seq,*seqlist; 初始化 seqlist init_seqlist() { seqlist sl = malloc(sizeof(seq)); sl->last =-1;//标记位,用于判断
阅读全文
摘要:双链表: 1 2 3 4 5 6 7 8 9 10 11 12 1 3 5 7 9 11 12 10 8 6 4 2 1。设计节点 typedef int datatyped typeddef struct node { typedata data; struct node * next; stru
阅读全文
摘要:单向循环链表 1。节点 typedef int datatype; typedef struct node { datatype data; struct node *next; }listnode,*linklist; 2.声明单向循环空链表,不带头结点的单向循环链表 linklist init_
阅读全文
摘要:单链表: 1 2 3 4 5 6 1.设计节点 typedef int datatype; typedef struct node { datatype data; struct node *next; }listnode,*linklist; listnode a; === struct node
阅读全文
摘要:/*练习:实现从键盘输入整数, 顺序表里面,按增长方式进行存储(输入正整数,插入数据,输入负整数,删除数据. 输入3 插入数据3 到顺序表里面;输入-3,把3数据从顺序顺删除)。 数据结构:指数据之间的相互关系包括: 1. 逻辑结构:表示数据运算之间的抽象关系 分:线性结构 和非线性结构 2. 存储
阅读全文