Top "Iterator" questions

An iterator is an object-oriented programming pattern that allows traversal through a collection, agnostic of the actual implementation or object addresses in physical memory.

java.util.ConcurrentModificationException with iterator

I know if would be trying to remove from collection looping through it with the simple loop I will be …

java iterator removechild concurrentmodification
In Kotlin, how do you modify the contents of a list while iterating

I have a list: val someList = listOf(1, 20, 10, 55, 30, 22, 11, 0, 99) And I want to iterate it while modifying some of the values. I …

list iterator kotlin mutable
Distinction between iterator and enumerator

An interview question for a .NET 3.5 job is "What is the difference between an iterator and an enumerator"? This is …

c# .net iterator generator enumeration
Index of an array element in Mustache.js

This is what I'd like to do in Mustache.js but not seeing how with the documentation. var view = {items:[…

javascript iterator mustache
How to iterate a boost property tree?

I am know approaching to boost property tree and saw that it is a good feature of boost libs for …

c++ xml iterator boost-propertytree
Iterate through binary search tree to find all leaves

I am pretty new to trees, and I am trying to create kind of a "leaf iterator". I'm thinking it …

java algorithm iterator nodes binary-search-tree
What happens if you increment an iterator that is equal to the end iterator of an STL container

What if I increment an iterator by 2 when it points onto the last element of a vector? In this question …

c++ stl vector iterator
Skip multiple iterations in loop

I have a list in a loop and I want to skip 3 elements after look has been reached. In this …

python loops iterator next continue
enumerate()-ing a generator in Python

I'd like to know what happens when I pass the result of a generator function to python's enumerate(). Example: def …

python iterator generator enumerate
What's the shortest way to count the number of items in a generator/iterator?

If I want the number of items in an iterable without caring about the elements themselves, what would be the …

python iterator generator iterable