![](https://img-blog.csdnimg.cn/20200814232818890.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
链表
I
Quanmator
这个作者很懒,什么都没留下…
展开
-
双链表基本操作
【结构体】struct ListNode{ int val; ListNode *prior; ListNode *next; ListNode():val(0),next(nullptr),prior(nullptr){} ListNode(int x):val(x),next(nullptr),prior(nullptr){}};【链表初始化】void listInit(ListNode *&head){ //带头结点 ListNode *dummy = new List原创 2022-03-17 21:35:27 · 785 阅读 · 0 评论 -
单链表基础操作
1、单链表【结构体】struct ListNode{ int val; ListNode *next; ListNode():val(0),next(nullptr){} ListNode(int x):val(x),next(nullptr){}};【链表插入元素】//插入 bool listInsert(ListNode* &l,int i,int e){ //遍历指针p ListNode *p,*cur; int j = 0; p = l; //找到第i-1原创 2022-03-17 12:00:40 · 724 阅读 · 0 评论