4 ms·
It depends on how closely you define "circular references". Assume you have an algorithm that does make use of circular references. Then, you could replace all
by vog 11y ago
It depends on how closely you define "circular references".
Assume you have an algorithm that does make use of circular references. Then, you could replace all pointers by integers. And you could put all referenced data into a large array.
That way you would have "broken up" all circular references. However, from another point of view, you could argue that your algorithm still makes use of circular references, they are just expressed differently.
(Also, now no garbage collector will help you cleaning up that thing, other than releasing that large array at once. So that's not really an improvement.)