3 ms·
That's true for slicing and indexes, but hopefully you can use Iterator then for basic traversal, which does this.
by viperscape 11y ago
That's true for slicing and indexes, but hopefully you can use Iterator then for basic traversal, which does this.
- catnaroek 11y agoYep, when iterators do the trick, they're preferable to indexing. But some algorithms (e.g., the tortoise and hare algorithm for cycle detection) explicitly require indexing.