当前位置:网站首页>集合--LinkedList
集合--LinkedList
2022-08-04 05:30:00 【Tokey_W】
前言
LinkedList---底层是双向链表
是有序,地址可以不联系,并且存入的数据可以重复
链表的基本单位是节点,双向链表的节点有两个地址区,头地址和尾地址
LinkedList没有默认容量,在增删元素时,LinkedList效率要高,要随机访问的时候ArrayList效率会略高
一、LinkedList的重要属性
1.链表的长度

2.链表的头结点
初始化的时候头结点为空 尾节点为空 头结点的前驱节点为空 头结点的item值为空

3.链表的尾节点
初始化的时候头结点为空 尾节点为空 尾结点的后继节点为空 尾结点的item值为空
4. 节点的情况
item元素值 prev前驱节点的地址 next后继节点的地址


二、新增
1.从头部加入


2.从尾部加入


三、删除
1.从头部删除

2.从尾部删除

总结
链表结构的节点新增、删除,把前后节点的指向修改,所以 LinkedList 新增和删除速度很快。
边栏推荐
- MOOSE平台使用入门攻略——如何运行官方教程的例子
- MFC读取点云,只能正常显示第一个,显示后面时报错
- [CV-Learning] Linear Classifier (SVM Basics)
- The second official example analysis of the MOOSE platform - about creating a Kernel and solving the convection-diffusion equation
- Postgresql snapshot
- 【论文阅读】Mining Cross-Image Semantics for Weakly Supervised Semantic Segmentation
- 光条提取中的连通域筛除
- 周志华机器学习
- 深度学习理论——过拟合、欠拟合、正则化、优化器
- (导航页)OpenStack-M版-双节点手工搭建-附B站视频
猜你喜欢

yoloV5 使用——训练速度慢,加速训练

安装pyspider后运行pyspider all后遇到的问题

MNIST Handwritten Digit Recognition - Lenet-5's First Commercial Grade Convolutional Neural Network

在AWS-EC2中安装Minikube集群

【CV-Learning】Object Detection & Instance Segmentation

腾讯、网易纷纷出手,火到出圈的元宇宙到底是个啥?

SQL注入详解

MNIST Handwritten Digit Recognition - Building a Perceptron from Zero for Two-Classification

AWS使用EC2降低DeepRacer的训练成本:DeepRacer-for-cloud的实践操作

Copy Siege Lion 5-minute online experience MindIR format model generation
随机推荐
pytorch学习-没掌握的点
arm交叉编译
No matching function for call to 'RCTBridgeModuleNameForClass'
Copy攻城狮的年度之“战”|回顾2020
yoloV5 使用——训练速度慢,加速训练
Pytest常用插件
LeetCode_22_Apr_2nd_Week
Golang environment variable settings (2)--GOMODULE & GOPROXY
Introduction to Convolutional Neural Networks
Amazon Cloud Technology Build On 2022 - AIot Season 2 IoT Special Experiment Experience
SQL注入详解
Deep Learning Theory - Overfitting, Underfitting, Regularization, Optimizers
A code example of the PCL method in the domain of DG (Domain Generalization)
【Copy攻城狮日志】“一分钟”跑通MindSpore的LeNet模型
MOOSE平台使用入门攻略——如何运行官方教程的例子
光条提取中的连通域筛除
Use of double pointers
tensorRT教程——tensor RT OP理解(实现自定义层,搭建网络)
Tencent and NetEase have taken action one after another. What is the metaverse that is so popular that it is out of the circle?
【论文阅读】TransReID: Transformer-based Object Re-Identification
