随笔分类 -  C plus plus

千年老妖的内力
摘要:集合类简介集合让程序员能在容器中快速的查找键(键:存储在一维容器中的值)set和multiset之间的区别就是set中的值唯一,multiset中的值可以不唯一。为实现快速搜索,集合的内部结构像二叉树,插入数据时对其进行排序。#include 实例化以set为例,multiset同样1 set se... 阅读全文
posted @ 2014-04-18 09:50 猫了个妖喵 阅读(250) 评论(0) 推荐(0)
摘要:What’s iterator?template classGeneric PointerGetting an iterator1 auto itr=container.cbegin();2 auto itr=container.cend();Iterator methods1 ++itr2 *it... 阅读全文
posted @ 2014-04-17 10:24 猫了个妖喵 阅读(158) 评论(0) 推荐(0)
摘要:Question:Given intergers A1,A2,…,An,find the maximum Subsequence Sum ProblemSolution:有很多方法可以解决这个问题。下面我只给出我认为最好的算法。 1 //linear-time maximum contiguous ... 阅读全文
posted @ 2014-04-16 09:10 猫了个妖喵 阅读(159) 评论(0) 推荐(0)
摘要:list简介#inlude 实质为双向链表是类模板实例化example: 1 //instantiate an empty list 2 list listA; 3 4 //instantiate a list with 7 intergers,each initialized to 0 5 li... 阅读全文
posted @ 2014-04-15 13:23 猫了个妖喵 阅读(149) 评论(0) 推荐(0)