2015年2月11日

[转]An STL compliant sorted vector-源码示例

摘要: 原文地址:http://www.codeproject.com/Articles/3217/An-STL-compliant-sorted-vector 最近在看sorted vectored的一些东西,自己封装了一个sorted vector类型,后来找到了codeproject上的一... 阅读全文

posted @ 2015-02-11 10:42 呆雁 阅读(430) 评论(0) 推荐(0)

[转]Why you shouldn't use set (and what you should use instead)

摘要: Why you shouldn't use set (and what you should use instead) ---stl::set和sorted ector对比Matt AusternEverything in the standard C++ library is there for ... 阅读全文

posted @ 2015-02-11 10:26 呆雁 阅读(191) 评论(0) 推荐(0)

封装的一个sorted_vector示例,实现了stl::set的一部分接口

摘要: STL set能保证最坏情况下的查找和插入效率,logN。但是维护红黑树开销较大。set内的元素按照一定的逻辑顺序组织,查找、插入等操作的结果都和排序规则有关。 适合STL set的情况为: 1、集合很大,以至于O(N)远大于O(longN)。2、查找和插入的次数一样多,且需要考虑插入的效... 阅读全文

posted @ 2015-02-11 10:12 呆雁 阅读(621) 评论(0) 推荐(0)

导航