摘要:
点击查看代码 //Reverse a linked list using recursion #include<iostream> using namespace std; struct node { int data; node* next; }; node* A;//思考局部头指针如何递归 vo 阅读全文
posted @ 2024-01-17 17:26
bituion
阅读(12)
评论(0)
推荐(0)
摘要:
点击查看代码 //Print linked list using recursion #include<iostream> using namespace std; struct node { int data; node* next; }; void print(node* p) { if (p 阅读全文
posted @ 2024-01-17 16:18
bituion
阅读(12)
评论(0)
推荐(0)
摘要:
点击查看代码 //Reversse a linked list #include<iostream> using namespace std; struct node { int data; node* next; }; node* A; void reverse() { node* next;// 阅读全文
posted @ 2024-01-17 15:43
bituion
阅读(9)
评论(0)
推荐(0)
摘要:
点击查看代码 //Delete d node at nth position #include<iostream> using namespace std; struct node { int data; node* next; }; node* A; void insert(int x) { no 阅读全文
posted @ 2024-01-17 12:08
bituion
阅读(55)
评论(0)
推荐(0)
摘要:
点击查看代码 //Inserting a node at nth position #include<iostream> using namespace std; struct node { int data; node* next; }; node* A;//全局头指针 void insert(i 阅读全文
posted @ 2024-01-17 10:53
bituion
阅读(19)
评论(0)
推荐(0)
摘要:
点击查看代码 //inserting a node at beginning,局部变量头指针版本2 #include<iostream> using namespace std; struct node { int data; node* next; }; void insert(int x, no 阅读全文
posted @ 2024-01-17 09:26
bituion
阅读(17)
评论(0)
推荐(0)
摘要:
点击查看代码 //inserting a node at beginning,局部变量头指针版本1 #include<iostream> using namespace std; struct node { int data; node* next; }; node* insert(int x,no 阅读全文
posted @ 2024-01-17 09:24
bituion
阅读(18)
评论(0)
推荐(0)
摘要:
点击查看代码 //inserting a node at beginning,全局变量头指针 #include<iostream> using namespace std; struct node { int data; node* next; }; node* A; void insert(int 阅读全文
posted @ 2024-01-17 09:23
bituion
阅读(8)
评论(0)
推荐(0)
摘要:
点击查看代码 //遍历链表,将节点接到末端 #include<iostream> using namespace std; struct node { int data;//数据 node* next;//尾巴 };//定义节点结构体 node* A;//头指针固定,global variable, 阅读全文
posted @ 2024-01-17 09:17
bituion
阅读(22)
评论(0)
推荐(0)

浙公网安备 33010602011771号