The first priority is performance (speed) in ms. What data structure to use to store text file quickly? Given that the text file could have variable no. of lines. Each line have variable no. of co-ordinates. And each of those co-ordinates need to go through calculations. Also, I want to sequentially access points, to do the calculations. And remove some of the co-ordinates, if necessary. There will be enough memory space available, thousand time more than the file size.
x1,y1 x2,y2 ....
x6,y6 x7,y7 .....
......
To be precise, the file is as below-
7866.777,505.821 -7866.773,508.291 -786.8402,500.845 -7864835.125147422,5084020.882938482
-7865228.42,508.491642 -7864114.999361482,5081606.040795522
-8865228.42,508.4642 -7864.999361,5081.040795522
Now how do I store each element quickly? Can I store it in vector? It is flexible, but its slow. Can I store it in 2d array? Is it fastest? But it has variable number of lines and different number of elements in each line. Also, number of elements in array needs to be constant, so is there other way to use dynamically growing array?
Update Since, details were asked, I'm updating the questions with details and trying to be precise as possible.