acwing-链表
单链表双链表
风有点大
good good study!!!
展开
-
【acwing】827. 双链表
模板 #include<iostream> using namespace std; const int N=100010; // value[]表示节点的值 //l[]表示节点的左指针 //r[]表示节点的右指针 //idx表示当前用到了哪个节点 int value[N],l[N],r[N],idx; //初始化 void init(){ //0是左端点,1是右端点 r[0]=1; l[1]=0; idx=2; } //在节点a的右边插入一个数x voi原创 2021-03-31 10:25:45 · 93 阅读 · 0 评论 -
【acwing】826. 单链表
模板 #include<iostream> using namespace std; const int N=100010; //head表示头节点的下标 //value[i]表示i节点的值 //next[i]表示节点i的next指针是多少 //idx表示存储当前已经用到了哪个点(已经用了几个点或者说下标已经到哪里了) int head ,value[N], next[N], idx; void init(){ head=-1; idx=0; } //将x插入到头节点位置原创 2021-03-30 20:46:39 · 67 阅读 · 0 评论