Yeah, that's pretty much what my structures are for:
Code:
i = 0 1 2 3 4 5 6 7 8 9 10
a[i].x = 1 2 3 4 5 6 6.1 6.2 6.3 6.4 6.5
a[i].y = 2 4 6 8 10 12 12.2 12.4 12.6 12.8 13.0
In linked list format they would look like
Code:
... a->prev a a->next ...
.x 6.1 6.2 6.3
.y 12.2 12.4 12.6
The point being, if I need to insert a new grid point between 6.2 and 6.3, say, I can do that easily with a linked list but not with an array. The drawback is that the code doesn't look as clean and is harder to understand and debug. Is it faster to run through each element of an array with a for loop than it is to follow the chain of pointers of a linked list?