-
quicker for inserts
i have a list of what will be about 12000 values of type short. currently im using a vector..but the test program is only about 100 values. is it significantly faster to use arrays or vectors? vectors are much easier to handle. the mainly operation will be inserting the values and retriving them, not many other operations will be done on them until theyre inserted into a matrix type thing, that im not sure of yet though.
any thoughts?
-
Use the vector and just make sure you reserve the necessary space for the number of items you expect prior to adding elements to the vector. That will make things quicker, eliminating any need for internal reallocation of memory.
-
well depends on wheather u will be accessing the data from the end , middle, inserting at back or middle etc etc..