2014-09-23 14:56:06 +08:00
2014-09-23 14:56:06 +08:00
2014-09-22 19:42:23 +08:00
2014-09-16 08:26:02 +08:00

TinySTL

采用C++11实现一款简易的STL标准库

目的:练习数据结构与算法和C++ Template编程

编译环境:VS2013及以上版本

##开发计划:

  • STL的几大基本组件,如string、vector、list、deque、set、map、unordered_*等
  • STL算法库中的大部分算法
  • circular buffer
  • bitmap
  • skip list
  • binary search tree
  • AVL tree
  • splay tree
  • rope
  • Van Emde Boas tree
  • treap
  • B-tree
  • trie
  • suffix array/tree
  • Disjoint-set data structure
  • k-d tree
  • R-tree
  • Graph

##完成进度:

  • STL的几大基本组件
    • type traits:100%
    • 空间配置器:100%
    • iterator traits:100%
    • vector:100%
    • STL Algorithms:
      • fill:100%
      • fill_n:100%

#TinySTL测试: ###测试环境:Windows 7 && VS2013 && release模式 ###测试结果: //std::vector vec; TinySTL::vector vec; ProfilerInstance::start(); int i = 0; for (; i != 10000; ++i){ vec.push_back(i); } ProfilerInstance::finish(); ProfilerInstance::dumpDuringTime();

######i = 100000 -> (TinySTL::vector:2ms \ std::vector:6ms) ######i = 1000000 -> (TinySTL::vector:11ms \ std::vector:16ms) ######i = 10000000 -> (TinySTL::vector:129ms \ std::vector:210ms)
//std::vectorstd::string vec; TinySTL::vectorstd::string vec; ProfilerInstance::start(); int i = 0; for (; i != 10000; ++i){ vec.push_back(std::string("zouxiaohang")); } ProfilerInstance::finish(); ProfilerInstance::dumpDuringTime();

######i = 100000 -> (TinySTL::vector:18ms \ std::vector:29ms) ######i = 1000000 -> (TinySTL::vector:181ms \ std::vector:232ms) ######i = 10000000 -> (TinySTL::vector:2372ms \ std::vector:1972ms)

S
Description
TinySTL is a subset of STL(cut some containers and algorithms) and also a superset of STL(add some other containers and algorithms)
Readme
551 KiB
0 Stars 1 Watchers 0 Forks
Languages
C++ 100%