当前位置:网站首页>Comparison of the differences between ArrayList and LinkedList
Comparison of the differences between ArrayList and LinkedList
2022-04-22 08:00:00 【Small planes love traveling】
ArrayList:
advantage :ArrayList Is the implementation of a dynamic array based data structure , Because the address is continuous , Once the data is stored , Inquire about The operation efficiency will be relatively high ( It's connected in memory ).
shortcoming : Because the address is continuous ,ArrayList To move data , So insert and delete operations are less efficient .
LinkedList:
advantage :LinkedList Data structures based on linked lists , The address is arbitrary , So there is no need to wait when opening up memory space A continuous address . For new and delete operations ,LinkedList predominance .LinkedList Suitable for head and tail exercises Make or insert the scene at the specified position .
shortcoming : because LinkedList To move the pointer , So the query operation performance is relatively low .
Applicable scenario analysis
When random access to data is needed , choose ArrayList.
When the data needs to be added, deleted and modified multiple times , use LinkedList. If the capacity is fixed , And will only be added to the tail , It will not cause capacity expansion , Give priority to ArrayList.
Of course , In most business scenarios , Use ArrayList That's enough , But care should be taken to avoid ArrayList Expansion of , And non smooth Insertion of order .
版权声明
本文为[Small planes love traveling]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220623382330.html
边栏推荐
- VC call control
- Xshell connect virtual machine
- Raspberry pie 4B: USB boot using raspi config
- 树莓派:访问Bitlocker To Go加密过的磁盘
- 读取WWH-OBD(ISO27145协议)数据流
- Simple C language exercise: access to student data
- Xcode select: failed to locate 'PIP3', requesting installation
- Plain CSRF vulnerability
- mysql中查询遇到longtext类型,查询效率很低。
- MFC common format conversion and function
猜你喜欢

六一节,赋诗一首

Grail layout and double wing layout

Wireshark在流量分析中的使用

Xshell connect virtual machine

Autoware demo test

Unity mask click the lower UI game to start guiding Click

圣杯布局和双飞翼布局

Raspberry Pie: access BitLocker to go encrypted disk

Solve the problem that the message notification is blocked by the El dialog ($message, $alert, $notify, $confirm)

Read SAE J1939 protocol data stream
随机推荐
Raspberry pie 4B: USB mobile hard disk box startup (beta version)
树莓派Lite:安装discuz最新版
MySQL queries the attributes of all fields in the database
解决ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed
Unityjson file creation and reading
软件开发规范
【从零开始写漏扫】主机发现——手写一个子域名挖掘器
[write missed scan from scratch] host discovery -- handwritten a subdomain name digger
树莓派:使用mono和C#调用MSSQL数据库
[communication interface can bus]
Misc novicate (Miscellaneous) notes
mysql查询数据库中所有字段的属性
echars动态实现散点图并自定义信息提示框
Bert模型系列一:输入到底是什么东西呢?
mysql中查询遇到longtext类型,查询效率很低。
一种简易的ESP32图文Web服务器的实现方式
QT common tool class function encapsulation summary
Continue raspberry pie 4B + OLED: automatically display the IP address after startup
Principle and application of SSRF and xxE attack
2021-10-08 Selenium无头模式打开浏览器