当前位置:网站首页>Array implementation of circular linked list
Array implementation of circular linked list
2022-06-22 18:34:00 【Underwood's heart】
#include <iostream>
using namespace std;
const int N = 100010;
int m;
int e[N], l[N], r[N], idx;
// initialization ,0 yes head,1 yes tail,idx from 2 Start
void init()
{
//0 Represents the left endpoint ,1 Represents the right endpoint
r[0] = 1;
l[1] = 0;
idx = 2;
}
// In the k The value inserted after nodes is x The node of
void add(int k, int x)
{
// Change four edges , So there are four pointer operations
e[idx] = x;
l[idx]=k;
r[idx]=r[k];
l[r[k]]=idx;
r[k]=idx;
}
// Delete the first k Nodes
void remove(int k)
{
l[r[k]] = l[k];
r[l[k]] = r[k];
}
边栏推荐
- docker: Error response from daemon: Conflict. The container name “/mysql“ is already in use by conta
- Make it more automatic to transfer slow logs and audit logs of RDS (for MySQL) databases to OBS across spaces
- 东华大学|具有强化知识感知推理的可解释推荐微观行为研究
- I became a big enemy when I bought wanghong ice cream
- [tools] related use of PIP and CONDA
- In May, 2022, China's game manufacturers and applications went to sea, with top 30 revenue in EMEA region
- 数组实现循环链表
- 利用Inkscape转换为dxf文件的正确方法 svg导出dxf文件
- 思维的定义
- sqlserver保存时遇到这个页面怎么回事啊
猜你喜欢

Interview shock 58: Six differences among truncate, delete and drop!

sqlserver保存时遇到这个页面怎么回事啊

2022年5月中国游戏厂商及应用出海 EMEA 地区收入30强

When do project managers particularly want to escape from work?

今天19:30 | 科普大佬说,带大家探寻AI如何激发人类的创造力

docker: Error response from daemon: Conflict. The container name “/mysql“ is already in use by conta

Activity start process sorting

大一女生废话编程爆火!懂不懂编程的看完都拴Q了

Cookie加密3+RPC解法

Grafana 9 is officially released, which is easier to use and more cool!
随机推荐
When online and offline integration accelerates and information docking channels are diversified, the traditional center will not be necessary
数据库行业分析:从全球IT产业趋势到国产数据库发展之路
RF analyzer demo setup
I became a big enemy when I bought wanghong ice cream
AHA C language Chapter 6 God, a large string of numbers is approaching (lesson 26)
Azkaban startup error 2022/06/20 21:39:27.726 +0800 error [stdouterrredirect] [azkaban] exception in thread "m
azkaban启动报错 2022/06/20 21:39:27.726 +0800 ERROR [StdOutErrRedirect] [Azkaban] Exception in thread “m
Live streaming: dongyuhui is so popular. Is there anyone watching liuzhenhong?
项目经理们在哪个时刻特别想逃离工作?
Activity启动流程梳理
各位大佬,第一次使用flink mysql cdc, 现在程序启动 没报错 新增数据没有打印出来
Nuxt - Universal (SSR / SSG) / single page app (rendering mode)
Using stream API instead of SQL
What is flush software? Is it safe to open an account online?
思维的定义
Jenkins配置项目集成钉钉通知
Grafana 9 is officially released, which is easier to use and more cool!
Traditional image -- LBP feature
Traitement des valeurs manquantes
Short video live broadcast source code, use of EditText input box