更新图片链接
This commit is contained in:
10
problems/数组总结篇.md
Normal file → Executable file
10
problems/数组总结篇.md
Normal file → Executable file
@@ -18,7 +18,7 @@
|
||||
|
||||
举一个字符数组的例子,如图所示:
|
||||
|
||||
<img src='https://code-thinking.cdn.bcebos.com/pics/%E7%AE%97%E6%B3%95%E9%80%9A%E5%85%B3%E6%95%B0%E7%BB%84.png' width=600> </img></div>
|
||||
<img src='https://file1.kamacoder.com/i/algo/%E7%AE%97%E6%B3%95%E9%80%9A%E5%85%B3%E6%95%B0%E7%BB%84.png' width=600> </img></div>
|
||||
|
||||
需要两点注意的是
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
例如删除下标为3的元素,需要对下标为3的元素后面的所有元素都要做移动操作,如图所示:
|
||||
|
||||
<img src='https://code-thinking.cdn.bcebos.com/pics/%E7%AE%97%E6%B3%95%E9%80%9A%E5%85%B3%E6%95%B0%E7%BB%841.png' width=600> </img></div>
|
||||
<img src='https://file1.kamacoder.com/i/algo/%E7%AE%97%E6%B3%95%E9%80%9A%E5%85%B3%E6%95%B0%E7%BB%841.png' width=600> </img></div>
|
||||
|
||||
而且大家如果使用C++的话,要注意vector 和 array的区别,vector的底层实现是array,严格来讲vector是容器,不是数组。
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
那么二维数组直接上图,大家应该就知道怎么回事了
|
||||
|
||||
<img src='https://code-thinking.cdn.bcebos.com/pics/%E7%AE%97%E6%B3%95%E9%80%9A%E5%85%B3%E6%95%B0%E7%BB%842.png' width=600> </img></div>
|
||||
<img src='https://file1.kamacoder.com/i/algo/%E7%AE%97%E6%B3%95%E9%80%9A%E5%85%B3%E6%95%B0%E7%BB%842.png' width=600> </img></div>
|
||||
|
||||
**那么二维数组在内存的空间地址是连续的么?**
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
看了下图,就应该明白了:
|
||||
|
||||
<img src='https://code-thinking.cdn.bcebos.com/pics/%E7%AE%97%E6%B3%95%E9%80%9A%E5%85%B3%E6%95%B0%E7%BB%843.png' width=600> </img></div>
|
||||
<img src='https://file1.kamacoder.com/i/algo/%E7%AE%97%E6%B3%95%E9%80%9A%E5%85%B3%E6%95%B0%E7%BB%843.png' width=600> </img></div>
|
||||
|
||||
所以**Java的二维数组在内存中不是 `3*4` 的连续地址空间,而是四条连续的地址空间组成!**
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
|
||||
## 总结
|
||||
|
||||

|
||||

|
||||
|
||||
这个图是 [代码随想录知识星球](https://programmercarl.com/other/kstar.html) 成员:[海螺人](https://wx.zsxq.com/dweb2/index/footprint/844412858822412),所画,总结的非常好,分享给大家。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user