
数据结构
文章平均质量分 78
爱旅行的姜姜
这个作者很懒,什么都没留下…
展开
-
数据结构学习记录-链表3
双向链表 typedef struct node { int data; struct node *next; struct node *prev; } 在双向链表末尾添加一个值 node* push_back(node *last,int info) { //如果是双向链表的第一个结点 if(last==NULL) {原创 2017-10-28 20:54:30 · 133 阅读 · 0 评论 -
数据结构学习记录-顺序栈
栈是线性表,存储结构可采用顺序(顺序栈)和链式(链式栈) typedef int Position; typedef struct SNode* PtrToSNode; struct SNode { ElementType *Data; //存储元素的数组 Position Top; //栈顶指针 int MaxSize; //栈的最大容量 }; type原创 2017-10-28 22:18:25 · 198 阅读 · 0 评论 -
算法笔记 STL ---- vector
Standard Template Library, STL vector的定义 vector<typename> name vector 容器内元素的访问 (1)通过下标访问 #include<stdio.h> #include<vector> using namespace std; int main() { vector<int&...原创 2019-09-12 14:46:26 · 315 阅读 · 0 评论 -
算法笔记 STL ---- set
set 集合,是一个内部自动有序且不含重复元素的容器。 set<typename> name set<typename>::iterator it (除了vector和string之外的STL容器都不支持*(it+i)的访问方式) set 内元素自动递增排序,且自动去除了重复元素 #include<stdio.h> #include<set>...原创 2019-09-12 15:45:03 · 210 阅读 · 0 评论 -
算法笔记 STL ---- string
string #include<stdio.h> #include<string> using namespace std; int main() { string str="abcd"; for(int i=0;i<str.length();i++) { printf("%c ",str[i]); } re...原创 2019-09-12 15:52:20 · 237 阅读 · 0 评论