stl使用与简单实现
文章平均质量分 63
Jack_Lpz
Jack_Li style
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Vector的使用与简单剖析
Vector的使用与简单剖析 STL是C++的精华! 我们首先要学会使用: 1.Vector的使用 #include"stdafx.h" #include #include #include usingnamespacestd; int_tmain(intargc,_TCHAR*argv[]) { vectorint>iVec; iVec.push_back(5);原创 2014-08-31 22:08:33 · 646 阅读 · 0 评论 -
list使用与简单实现
1.首先我们看看怎么使用 #include"stdafx.h" #include #include #include usingnamespacestd; int_tmain(intargc,_TCHAR*argv[]) { listint>iList; iList.push_back(1); iList.push_back(2); iList.push_back(7原创 2014-08-31 22:11:36 · 682 阅读 · 0 评论 -
stack使用与简单实现
1)首先介绍下Satck的使用 #include"stdafx.h" #include #include #include usingnamespacestd; intmain() { stackint,listint>> iStack; iStack.push(1); //进行数据的压入 iStack.push(4); iStack.push(7); iSta原创 2014-08-31 22:15:32 · 673 阅读 · 0 评论 -
链式stack
#include"stdafx.h" #include usingnamespacestd; templateclassT> classListNode //节点类 { public: typedefListNodeT>*pListNode; typedefListNodeT>&rListNode; public: ListNodeT>*Next; Tval原创 2014-08-31 22:15:10 · 507 阅读 · 0 评论 -
Queue的顺序实现
1)首先我们还是看一下STL关于queue的使用方法 #include"stdafx.h" #include #include #include usingnamespacestd; int_tmain(intargc,_TCHAR*argv[]) { dequeint>iQue(20,0); //定义了个元素初值为 cout"size= "iQue原创 2014-08-31 22:18:46 · 1668 阅读 · 0 评论 -
链式Queue的实现
#include"stdafx.h" #include #include usingnamespacestd; templateclassT> classListNode //节点类 { protected: typedefListNodeT>*pListNode; typedefListNodeT>&rListNode; public: ListNodeT>*Ne原创 2014-08-31 22:17:04 · 504 阅读 · 0 评论 -
二叉树的简介
1.树是n个结点的优先集合T,满足一下的性质: 1)有一个被称之为root的结点 2)有其余的结点可以分为m个互不相交的集合T1,T2,T3,,,这些集合本身也是一棵树,每颗子树也有自己的根结点。 2.一些名词介绍 度:树中每个结点具有的子树的数目称为该结点的度 度为0的结点称为叶子或者终端节点。不为0的称之为非终端结点或者分支结点。 结点的子树的根称为该结点的孩子,在原创 2014-08-31 22:20:14 · 859 阅读 · 0 评论 -
顺序容器容器适配器的模板定义
1)首先发表一下感概,看了一些顶层容器的实现过程,发现这些东西有着千丝万缕的联系,例如顺序中加载这一些容器适配器,在SGI中,Alloator这个底层的适配器算是最好的供应者。 2)模板定义之vector template > classvector {……} //在VC源代码中截取了一部分模板定义 vector定义在的头文件中,在VS中的路径(默认情况下C:\ProgramFiles原创 2014-08-31 22:21:24 · 847 阅读 · 0 评论
分享