3 ms·
There isn’t anything weird about this. A circularly linked list is a common data structure that, when empty, has a pointer pointing to itself. Self-referentia
by anderskaseorg 6y ago
There isn’t anything weird about this. A circularly linked list is a common data structure that, when empty, has a pointer pointing to itself.
Self-referential structures can be optimized in accordance with all the usual rules. If there are no other references to them, they can be optimized away. (This optimization is implemented by using a flood fill to mark everything that’s used, and then removing everything else, so that circular references need no special treatment.)