Loading... 这是当时学习留下的笔记,现在做一个汇总,希望对大家有用。 ### 1.STL简介 <div class="preview"> <div class="post-inser post box-shadow-wrap-normal"> <a href="https://blog.fivk.cn/archives/461.html" target="_blank" class="post_inser_a no-external-link no-underline-link"> <div class="inner-image bg" style="background-image: url(https://blog.fivk.cn/usr/themes/handsome/assets/img/sj/6.jpg);background-size: cover;"></div> <div class="inner-content" > <p class="inser-title">【C++】STL学习</p> <div class="inster-summary text-muted"> STL概述1.1stl的基本概念1.2 stI的六大组件1.3 STL优点STL是C++的一部分,因此不用额外安装... </div> </div> </a> <!-- .inner-content #####--> </div> <!-- .post-inser ####--> </div> <div class="preview"> <div class="post-inser post box-shadow-wrap-normal"> <a href="https://blog.fivk.cn/archives/468.html" target="_blank" class="post_inser_a no-external-link no-underline-link"> <div class="inner-image bg" style="background-image: url(https://blog.fivk.cn/usr/uploads/2021/04/1930645165.png);background-size: cover;"></div> <div class="inner-content" > <p class="inser-title">【C++】STL三大组件</p> <div class="inster-summary text-muted"> 1.容器保存数据的(数据结构)常用的数据结构:数组(array),链表(list),tree(树),栈(stack... </div> </div> </a> <!-- .inner-content #####--> </div> <!-- .post-inser ####--> </div> ### 2.字符串和数组 <div class="preview"> <div class="post-inser post box-shadow-wrap-normal"> <a href="https://blog.fivk.cn/archives/469.html" target="_blank" class="post_inser_a no-external-link no-underline-link"> <div class="inner-image bg" style="background-image: url(https://blog.fivk.cn/usr/uploads/2021/04/2956183892.png);background-size: cover;"></div> <div class="inner-content" > <p class="inser-title">【C++】STL常用容器_string容器</p> <div class="inster-summary text-muted"> string 容器的基本概念C风格字符串(以空字符结尾的字符数组)太过于复杂,不适合大程序的开发,所以C++标注库... </div> </div> </a> <!-- .inner-content #####--> </div> <!-- .post-inser ####--> </div> <div class="preview"> <div class="post-inser post box-shadow-wrap-normal"> <a href="https://blog.fivk.cn/archives/478.html" target="_blank" class="post_inser_a no-external-link no-underline-link"> <div class="inner-image bg" style="background-image: url(https://blog.fivk.cn/usr/uploads/2021/04/686695949.png);background-size: cover;"></div> <div class="inner-content" > <p class="inser-title">【C++】STL常用容器_vector容器</p> <div class="inster-summary text-muted"> vector 容器的基本概念vector 迭代器根据上述描述,如果我们写如下的代码:#include<ios... </div> </div> </a> <!-- .inner-content #####--> </div> <!-- .post-inser ####--> </div> ### 3.队列 <div class="preview"> <div class="post-inser post box-shadow-wrap-normal"> <a href="https://blog.fivk.cn/archives/492.html" target="_blank" class="post_inser_a no-external-link no-underline-link"> <div class="inner-image bg" style="background-image: url(https://blog.fivk.cn/usr/uploads/2021/04/1897294940.png);background-size: cover;"></div> <div class="inner-content" > <p class="inser-title">【C++】STL常用容器_queue容器</p> <div class="inster-summary text-muted"> queue容器基本概念Queue是一种先进先出(First In First Out,FIFO)的数据结构,它有两... </div> </div> </a> <!-- .inner-content #####--> </div> <!-- .post-inser ####--> </div> <div class="preview"> <div class="post-inser post box-shadow-wrap-normal"> <a href="https://blog.fivk.cn/archives/482.html" target="_blank" class="post_inser_a no-external-link no-underline-link"> <div class="inner-image bg" style="background-image: url(https://blog.fivk.cn/usr/uploads/2021/04/1234363700.png);background-size: cover;"></div> <div class="inner-content" > <p class="inser-title">【C++】STL常用容器_deque容器</p> <div class="inster-summary text-muted"> deque容器的基本Vector容器是单向开口的连续内存空间,deque则是一种双向开口的连续线性空间。所谓的双向... </div> </div> </a> <!-- .inner-content #####--> </div> <!-- .post-inser ####--> </div> - `queue`是普通队列 - `deque`是双端队列 ### 4.栈 <div class="preview"> <div class="post-inser post box-shadow-wrap-normal"> <a href="https://blog.fivk.cn/archives/490.html" target="_blank" class="post_inser_a no-external-link no-underline-link"> <div class="inner-image bg" style="background-image: url(https://blog.fivk.cn/usr/uploads/2021/04/404106754.png);background-size: cover;"></div> <div class="inner-content" > <p class="inser-title">【C++】STL常用容器_stack容器</p> <div class="inster-summary text-muted"> stack 容器基本概念stack是一种先进后出(Firstt In Out,FILO),它只有一个出口,形如图所... </div> </div> </a> <!-- .inner-content #####--> </div> <!-- .post-inser ####--> </div> ### 5.链表 <div class="preview"> <div class="post-inser post box-shadow-wrap-normal"> <a href="https://blog.fivk.cn/archives/499.html" target="_blank" class="post_inser_a no-external-link no-underline-link"> <div class="inner-image bg" style="background-image: url(https://blog.fivk.cn/usr/uploads/2021/04/3769691634.png);background-size: cover;"></div> <div class="inner-content" > <p class="inser-title">【C++】STL常用容器_list容器</p> <div class="inster-summary text-muted"> list容器基本概念链表是一种物理存储单元上非连续、非顺序的存储结构,数据元素的逻辑顺序是通过链表中的指针链接次序... </div> </div> </a> <!-- .inner-content #####--> </div> <!-- .post-inser ####--> </div> ### 6.set和map <div class="preview"> <div class="post-inser post box-shadow-wrap-normal"> <a href="https://blog.fivk.cn/archives/503.html" target="_blank" class="post_inser_a no-external-link no-underline-link"> <div class="inner-image bg" style="background-image: url(https://blog.fivk.cn/usr/uploads/2021/04/389430755.png);background-size: cover;"></div> <div class="inner-content" > <p class="inser-title">【C++】STL常用容器_set/multiset容器</p> <div class="inster-summary text-muted"> set容器基本概念Set的特性是。所有元素都会根据元素的键值自动被排序。Set的元素不像map那样可以同时拥有实值... </div> </div> </a> <!-- .inner-content #####--> </div> <!-- .post-inser ####--> </div> <div class="preview"> <div class="post-inser post box-shadow-wrap-normal"> <a href="https://blog.fivk.cn/archives/507.html" target="_blank" class="post_inser_a no-external-link no-underline-link"> <div class="inner-image bg" style="background-image: url(https://blog.fivk.cn/usr/uploads/2021/04/4108781050.png);background-size: cover;"></div> <div class="inner-content" > <p class="inser-title">【C++】STL常用容器_map/multimap容器</p> <div class="inster-summary text-muted"> map/multimap基本概念Map的特性是,所有元素都会根据元素的键值自动排序。Map所有的元素都是pair,... </div> </div> </a> <!-- .inner-content #####--> </div> <!-- .post-inser ####--> </div> > set和map底层实现是红黑树,红黑树为平衡二叉树的一种。 > > 其实还有`unordered_set`和`unordered_map`底层采用哈希表的实现,查询的时间复杂度为是O(1),可以用来查询。 最后修改:2022 年 01 月 22 日 © 允许付费转载 打赏 赞赏作者 支付宝微信 赞 1 如果觉得我的文章对你有用,请随意赞赏