
数据结构
羊不想说话
Fake it till you make it。
展开
-
单链表的基本操作
单链表的基本操作 包括:初始化,插入,删除,逆置,求表长 定义链表的数据结构 struct node { int data; node *next; }; 初始化链表 node* create(node* head) { head = new node; head->next = NULL; return head; } 链表的插入(头插法) node* in...原创 2019-07-25 14:42:25 · 370 阅读 · 0 评论 -
单链表实现队列的基本操作(入队,出队)
单链表实现队列的基本操作(包括初始化队列,入队,出队) 构造队列结构体 struct node { int data; node *next; }; struct queue { node *head, *tail; }; 队列初始化 queue* create(queue *q) { q->head = new node; q->...原创 2019-07-25 20:49:44 · 6200 阅读 · 1 评论