Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
c++的函数reserve()和unique()和sort()
函数reserve span class token comment vector reserve span span class token macro property span class token directive keywor
reserve
unique
sort
使用reserve来避免不必要的内存重新分配
STL容器的内存分配策略是 xff0c 他们会自动增长以便容纳下你放入其中的数据 xff0c 只要没有超过它的最大限制就可以 xff08 要查看最大限制可调用名为max size的成员函数 xff09 对于vector和string xff
reserve
来避免不必要的内存重新分配