By using two expansion strategies, one for each additional fixed memory space and one for double up memory space, the amortized time complexity of inserting an element of vector of size n is:分别采用每次追加固定内存空间和每次内存空间翻倍两种扩容策略,在规模为n的向量中插入一个元素的分摊时间复杂度为:
AO(n),O(1)
BO(n),O(n)
CO(1),O(1)
DO(n),O(log2(n))