In order to avoid browsing the data structure from the root every time, you may want to keep a stack of pairs (reference, index) instead.
In reply to Re: An iterator for (not "iterating") a recursive data structure.
by salva
in thread An iterator for (not "iterating") a recursive data structure.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |