当前位置:网站首页>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.
边栏推荐
- Kotlin 中的泛型介绍
- 神经网络之感知机
- 自监督论文阅读笔记DisCo: Remedy Self-supervised Learning on Lightweight Models with Distilled Contrastive
- Gradle插件与代理服务器导致Sync Project失败的问题
- 【第四周】MobileNet和HybridSN
- ZEMAX | 如何使用ZOS-API创建自定义操作数
- 自监督论文阅读笔记Efficient Self-supervised Vision Pretraining with Local Masked Reconstruction
- 001_旭日X3派初探:开箱测试
- Makefile自动推导的简单例程
- ZEMAX | 如何围绕空间中的任何点旋转任何元素
猜你喜欢
随机推荐
采用Trench肖特基二极管,实现功率密度的显著提升
嵌入汇编-1 格式讲解
对象の使用
ZEMAX | 如何创建简单的非序列系统
自监督论文阅读笔记Efficient Self-supervised Vision Pretraining with Local Masked Reconstruction
借助ginput函数在figure窗口实时读取、展示多条曲线的坐标值
ucosII OSMemCreate()函数的解析
自监督论文阅读笔记 Ship Detection in Sentinel 2 Multi-Spectral Images with Self-Supervised Learning
电子元器件的分类有哪些?
交叉熵(第六周)
常见的电子元器件分类介绍
布尔盲注需简化代码
VSCODE 常见问题
建立平衡二叉树简单demo
芯片解密工作应该具备哪些条件?唯样商城
B.1#【编程语言】—1 arm 汇编指令
Mysql 外键详解(Foreign Key)
Kotlin 中的泛型介绍
ZEMAX | 如何倾斜和偏心序列光学元件
Qlik Sense 临时处理表数据详解(Resident)