Avoids potentially expensive (depending on the size of the memory block) allocations by reserving the necessary memory before performing both insertions. This avoids scenarios where the second insert may cause a reallocation to occur.