A
Antonio Gulli
Hi, i need to create a list of list in STL where each element can move
from a given list level to the adjacent list.
i.e.
| -> x -> y -> z
| -> a -> b
can be modified to
| -> x -> y
| -> z -> a -> b
the idea is that element can jump back the head of each list and then
acces the other adjacent list (below). Space is not an issue: I accept
the cost of the back pointer. But operation should be done in O(1).
What is the best way to describe this in STL?
from a given list level to the adjacent list.
i.e.
| -> x -> y -> z
| -> a -> b
can be modified to
| -> x -> y
| -> z -> a -> b
the idea is that element can jump back the head of each list and then
acces the other adjacent list (below). Space is not an issue: I accept
the cost of the back pointer. But operation should be done in O(1).
What is the best way to describe this in STL?