当前位置:网站首页>Leetcode learning records (starting from the novice village, you can't kill out of the novice Village) ---1
Leetcode learning records (starting from the novice village, you can't kill out of the novice Village) ---1
2022-07-06 21:52:00 【Aspire to get a high salary】
Array overview

aggregate : Simply speaking , It can be said to be a whole composed of one or more elements . The types of elements that make up the set can be different , At the same time, these elements are also disordered .
list : It's a linear table . It consists of elements arranged together in a certain order , Is ordered . The common forms of lists are : Array 、 Linked list 、 Pile up 、 Stack .
Array : Array introduces the concept of index , You can find the position of the corresponding element by subscript . meanwhile , Due to the subscript , Prove that the data stored in the array is continuous . Unlike arrays , Linked lists are not continuous .
Array reading : According to the array subscript, you can find the corresponding element , Operate on only one data , So the time complexity is zero O(1).
Array search : Consider the worst case , If the data to be searched is at the end , Then you need to start from the 0 The position index goes all the way to the last index of the array . So the time complexity is O(N).
Array insertion : If you want to insert this element at the end of the array , Just one step . That is, the computer calculates the memory address of the element to be inserted through the length and position of the array , Then insert the element into the specified position . However , If you want to insert the element elsewhere in the array , There will be a difference , At this time, we first need to make room for the position where the element is to be inserted , Then insert it .
Array deletion : Deleting an element is similar to inserting an element , When we delete an element in the array , The array will leave vacancy The location of , The elements in the array are continuous in memory , This makes the following elements need to fill the position .
Example 1: Power button
https://leetcode-cn.com/problems/find-the-middle-index-in-array/
Just started, I can only traverse ( I feel like I can't get out of the novice village )

边栏推荐
- Start the embedded room: system startup with limited resources
- JPEG2000-Matlab源码实现
- Why is the cluster mode of spark on Yan better than the client mode
- guava:Collections. The collection created by unmodifiablexxx is not immutable
- Mysql相关术语
- Digital transformation takes the lead to resume production and work, and online and offline full integration rebuilds business logic
- 抖音将推独立种草App“可颂”,字节忘不掉小红书?
- Sql: stored procedures and triggers - Notes
- JS operation DOM element (I) -- six ways to obtain DOM nodes
- Is it important to build the SEO foundation of the new website
猜你喜欢

Vit paper details

C how to set two columns comboboxcolumn in DataGridView to bind a secondary linkage effect of cascading events

It's not my boast. You haven't used this fairy idea plug-in!

Yuan Xiaolin: safety is not only a standard, but also Volvo's unchanging belief and pursuit

红杉中国,刚刚募资90亿美元

Checkpoint of RDD in spark

numpy 下载安装
![[daily] win10 system setting computer never sleeps](/img/94/15f5a368e395b6948f409c5f6fc871.jpg)
[daily] win10 system setting computer never sleeps
![Happy sound 2[sing.2]](/img/ca/1581e561c427cb5b9bd5ae2604b993.jpg)
Happy sound 2[sing.2]

Sparkshuffle process and Mr shuffle process
随机推荐
Reinforcement learning - learning notes 5 | alphago
华为在多个行业同时出击,吓人的技术让欧美企业瑟瑟发抖
mysql根据两个字段去重
14年本科毕业,转行软件测试,薪资13.5K
[Chongqing Guangdong education] Information Literacy of Sichuan Normal University: a new engine for efficiency improvement and lifelong learning reference materials
Caching strategies overview
Comparison between multithreaded CAS and synchronized
LeetCode:1189. The maximum number of "balloons" -- simple
在Pi和Jetson nano上运行深度网络,程序被Killed
The underlying implementation of string
Aggregate function with key in spark
关于char[]数组通过scanf赋值使用上的一些问题。。
Start the embedded room: system startup with limited resources
Enhance network security of kubernetes with cilium
[Li Kou brush questions] 32 Longest valid bracket
SQL:存储过程和触发器~笔记
[Yu Yue education] reference materials for surgical skills teaching in Tongji University
Why does MySQL index fail? When do I use indexes?
【力扣刷题】32. 最长有效括号
[Yu Yue education] higher mathematics of Nanchang University (2) reference materials