
1 May
2013
1 May
'13
11:09 a.m.
El 30/04/2013 3:00, Nat Goodspeed escribió:
On Apr 29, 2013, at 12:34 PM, Ion Gaztañaga
wrote: There is no way to obtain the end node from a node in a circular list, as there is no runtime information stored in the ring that marks the end node.
But with a (non-empty) circular list, can't you just iterate until you return to your starting point?
The iterator does not know which node is the starting point (only the container stores a pointer to the first node). The iterator only stores a pointer to the next node, it does not know if the next node is the last or the first node as it's a circular slist. Ion