当前位置:网站首页>Double linked list related operations
Double linked list related operations
2022-07-01 12:22:00 【Between the steps】
Double linked list related operations
Double linked list related operations
Initialization of double linked list
#include<stdio.h>
typedef struct DNode{
int data;
struct DNode *prior,*next;
}DNode,*DLinklist;
// Initialize double linked list
bool InitDLinkList(DLinklist &L){
L=(DNode*)malloc(sizeof(DNode)); // Assign a head node
if(L==NULL){
return false;
}
L->prior=NULL; // The first node prior For ever NULL
L->next=NULL;
return true;
}
// The list is empty
bool Empty(DLinklist L){
if(L->next==NULL)
return true;
else
return false;
}
void main(){
DLinklist L;
InitDLinkList(L);
}
Insertion of double linked list
bool InsertNextDNode(DNode *p,DNode *s){
if(p==NULL||s==NULL){
return false;
}
s->next=p->next; // The node *s Insert to node *p after
if(p->next!=NULL)
p->next->prior=s;
s->prior=p;
p->next=s;
return true;
}


Deletion of double linked list nodes
// Delete p The successor node of a node
bool InsertNextDNode(DNode *p){
if(p==NULL){
return false;
}
DNode *q=p->next; // find p The successor node of
if(q==NULL){
return false; //p No successor nodes
}
p->next=q->next;
if(q->next!=NULL) //q Node is not the last node
q->next->prior=p
free(q); // Release node space
return true;
}


Destroy a double linked list
Traversal of double linked list
边栏推荐
- Rural guys earn from more than 2000 a month to hundreds of thousands a year. Most brick movers can walk my way ǃ
- easyexcel的使用
- Joint Time-Frequency and Time Domain Learning for Speech Enhancement
- USB peripheral driver - cable connect/disconnect
- Onenet Internet of things platform - mqtt product devices send messages to message queues MQ
- 自组织是管理者和成员的双向奔赴
- IOS interview
- Technology sharing | MySQL: how about copying half a transaction from the database?
- Uniapp uses uni upgrade Center
- 2022-06-28-06-29
猜你喜欢

I wish you all a happy reunion
![[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 5](/img/f5/9c68b3dc30362d3776c262fdc13fd0.jpg)
[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 5
![[some notes]](/img/91/7657f90b50f012736579b1585b4ade.jpg)
[some notes]

Uniapp uses uni upgrade Center
![[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 7](/img/41/e3ecbd49e4bfeab6c6e7d8733fe33a.jpg)
[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 7

Seckill system 03 - redis cache and distributed lock

Sleep quality today 79 points
![[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 6](/img/0e/0900e386f3baeaa506cc2c1696e22a.jpg)
[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 6
![[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 4](/img/4f/bc6c39ef4f2d1c4bdad8420f7badac.jpg)
[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 4
![Wechat applet reports an error: [rendering layer network layer error] pages/main/main Local resource pictures in wxss cannot be obtained through wxss. You can use network pictures, Base64, or < image/](/img/6a/fe448ca635690bc5260436546b588e.jpg)
Wechat applet reports an error: [rendering layer network layer error] pages/main/main Local resource pictures in wxss cannot be obtained through wxss. You can use network pictures, Base64, or < image/
随机推荐
Self organization is the two-way rush of managers and members
队列操作---
Summary of JFrame knowledge points 1
Wechat applet reports an error: [rendering layer network layer error] pages/main/main Local resource pictures in wxss cannot be obtained through wxss. You can use network pictures, Base64, or < image/
Use set_ Handler filters out specific SystemC wrapping & error messages
On recursion and Fibonacci sequence
谈思生物直播—GENOVIS张洪妍抗体特异性酶切技术助力抗体药物结构表征
自组织是管理者和成员的双向奔赴
USB peripheral driver - cable connect/disconnect
顺序表有关操作
栈-------
Compile and debug net6 source code
IOS interview
C summary of knowledge points 3
[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 2
91.(cesium篇)cesium火箭发射模拟
[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 3
Pandas reads MySQL data
Message queue monitoring refund task batch process
Sleep quality today 79 points

