Loading

C/C++ STL - Containers

  • Sequence Containers
  • Associative Containers
  • Special Containers

Sequence Containers

sequence_containers.png

vector

assignment

vecotr<int> nums(__n, __val);
nums.assign(__n, __val);
nums.resize(__new_size, __x);

preallocate

nums.reserve(__n);

attributes

nums.size();
nums.capacity();

elements

nums[0];
nums.front();
nums.back();
nums.push_back();
nums.pop_back();

stack

priority_queue

Associative Containers

associative_containers

Special Containers

special_containers

References

posted @ 2021-05-10 11:18  CrayonSea  阅读(57)  评论(0编辑  收藏  举报