当前位置:网站首页>6. What is the difference between Vector, ArrayList and LinkedList?(design, performance, safety)
6. What is the difference between Vector, ArrayList and LinkedList?(design, performance, safety)
2022-08-03 06:10:00 【Shiyu】
All implement the list interface, providing corresponding methods for adding, getting, and deleting objects, etc.
One, low-level design implementation, security, performance
Vector: The low-level implementation is implemented with an array, which is thread-safe, but inefficient. It is suitable for use in multiple threads, often reads objects, and uses less insertion and deletion.
ArrayList: The low-level implementation is implemented using an array, which is thread-unsafe and efficient. It is suitable for use in a single thread, often reads objects, and uses less insertion and deletion.
LinkedList: The low-level is implemented by a doubly linked list, which is not thread-safe and is suitable for reading less, frequently inserting and deleting objects.
Second, initial value, expansion multiple and expansion factor
Vector: 10 size+size*0.5+1= size*1.5+1 1
ArrayList: 10 size+size*1= 2*size 0.75
LinkedList: No expansion required, linked list implementation, dynamic expansion.
边栏推荐
猜你喜欢

自监督论文阅读笔记 Self-Supervised Visual Representation Learning with Semantic Grouping

自监督论文阅读笔记 TASK-RELATED SELF-SUPERVISED LEARNING FOR REMOTE SENSING IMAGE CHANGE DETECTION

Qlik Sense 聚合函数及范围详解(Sum、Count、All、ToTaL、{1})

微信小程序 自定义tabBar

关于芯片你了解吗?
ASP.NET MVC3的伪静态实现

MySql的Sql语句的练习(试试你能写出来几道呢)

IPC 通信 - IPC

自监督论文阅读笔记 S3Net:Self-supervised Self-ensembling Network for Semi-supervised RGB-D Salient Object Det

Kettle Spoon 安装配置详解
随机推荐
IO 复用
STM32启动文件的选择
servlet学习(七)ServletContext
Qlik Sense 临时处理表数据详解(Resident)
自监督论文阅读笔记 Self-Supervised Visual Representation Learning with Semantic Grouping
神经网络之感知机
微信小程序 自定义tabBar
自监督论文阅读笔记 Incremental-DETR:Incremental Few-Shot Object Detection via Self-Supervised Learning
自监督论文阅读笔记FIAD net: a Fast SAR ship detection network based on feature integration attention and self
VSCODE 常见问题
观看华为AI技术领域课程--深度学习前三章总结
Dynamic adjustment subject web system?Look at this one is enough
2021-04-30
ASP.NET MVC3的伪静态实现
设备树解析源码分析<devicetree>-1.基础结构
东南亚跨境电商
A.1#【内存管理】——1.1.2 zone: struct zone
MATLAB自带的dwt2和wavedec2函数实现基于小波变换的自适应阈值图像边缘检测
常见的电子元器件分类介绍-唯样商城
opencv