For an application, I need a data structure that
- is used to keep small structs (3 ints)
- needs to be traversed in forward direction only
- is filled once (size and values known on initialization) and
- needs to allow deleting elements
It is not necessary that the nodes' is freed immediately upon deletion. I would assume that using a list
causes more overhead, due to how it allocates memory. Using vectors is probably also not ideal, because of the deletions.
I thought, the most useful structure could be a linked list on a contiguous piece of memory. Nodes can be deleted by rewriting the nodes' forward/backward pointers, but memory is only freed when the entire list is destroyed. Alternatively, I thought about a vector, equipped with another vector that contains the indices of the next/previous non-deleted element, but that's basically the same I guess.
This doesn't sound like something no-one had used before. Does it have a name? Is there a common implementation, for instance in STL or boost?