当前位置:网站首页>LinkedList learning
LinkedList learning
2022-06-29 02:38:00 【Why not sell egg cakes well】
Different data structures lead to different characteristics , The linked list structure is good at handling the problem of adding and deleting ( Just modify the pointer of a few elements ), Arrays are good for processing queries ( Array subscripts are easy to locate )
The code is as follows
First in first out queue , Linked list form .
Elements are connected by storing each other's location information , Search slow , add to / Delete fast .
There is no data movement problem , Just modify the subsequent pointer .
public static void main(String[] args) {
LinkedList list = new LinkedList();
list.add("hello");
list.add("world");
System.out.println(list);
list.addFirst("A");
list.addLast("B");
System.out.println(list);
list.add(2,"2");
System.out.println(list);
// fifo Add from left
list.push("javase");
System.out.println(list);
System.out.println(list.getFirst());
System.out.println(list.peek());
System.out.println(list.peekFirst());
// Take the value out , Does not exist.
System.out.println(list.pop());
System.out.println(list);
}

边栏推荐
- 11 go Foundation: Interface
- Quelques tests pour compléter l'environnement wasm
- Kubernetes: container resource requirements and constraints (constraints)
- What is the dry goods microservice architecture? What are the advantages and disadvantages?
- Have you learned the common SQL interview questions on the short video platform?
- 兰宝传感科技冲刺科创板:年营收3.5亿 许永童家族色彩浓厚
- fsockopen函数的应用
- Which securities company is the largest and safest? Which securities company has good service
- 矩阵特征值和特征向量求解——特征值分解(EVD)
- 【一起上水硕系列】最简单的字幕配置
猜你喜欢

Deploy redis high availability cluster

Target detection - ADAS practice

CTFHub-Web-密码口令-默认口令

Chrome browser close update Popup
![[untitled]](/img/36/2f9319e05157ab6a8dd5aa3bef4505.png)
[untitled]

干货丨微服务架构是什么?有哪些优点和不足?

How to use project Gantt chart to make project report

Ctfhub web SQL injection - integer injection

Project R & D, what are the free brain mapping tools that are easy to use

Boost the digital economy and face the future office | the launch of the new version of spreadjsv15.0 is about to begin
随机推荐
What is the Valentine's Day gift given by the operator to the product?
Which brokerage is safer and more convenient to open a stock account for big smart phones?
Informatics Olympiad all in one 1361: production | Luogu P1037 [noip2002 popularization group] production
Leetcode counts the number of ways to place houses
mark
Oracle Recovery Tools实战批量坏块修复
【一起上水硕系列】最简单的字幕配置
PMP商业分析概述
Leetcode counts the logarithm of points that cannot reach each other in an undirected graph
Koa 快速入门
[network communication learning notes] socket IO setup and deployment
Prepare for the Blue Bridge Cup - double pointer, BFS
Learning Tai Chi Maker - mqtt Chapter II (IX) test of this chapter
字符串替换
To apply for a test engineer after years, the resume with high scores should be written like this
Which securities company is the largest and safest? Which securities company has good service
Ctfhub web password default password
Troubleshooting of pyinstaller failed to pack pikepdf
Convert flat structure to tree structure
[untitled]