About 16,700,000 results
Open links in new tab
  1. What are iterator, iterable, and iteration? - Stack Overflow

    Iterator: Iterator are the object which call next method and transverse through the sequence. On calling the next method it returns the object that it traversed currently.

  2. What does the "yield" keyword do in Python? - Stack Overflow

    Oct 24, 2008 · An iterable returns an iterator upon calling the iter () on the iterable, and an iterator doesn't always have to store its values in memory, depending on the implementation of the iter …

  3. iterator - Is there any built-in way to get the length of an iterable ...

    Short of iterating through the iterable and counting the number of iterations, no. That's what makes it an iterable and not a list. This isn't really even a python-specific problem. Look at the classic linked-list …

  4. Incrementing iterators: Is ++it more efficient than it++?

    Oct 26, 2018 · The reason is that if the iterator class itself is at all complex, then because it++ has to return the value before it is incremented, the implementation will generally make a copy. Vector …

  5. Reset list iterator to first element of the list - Stack Overflow

    LinkedList<String> list; Iterator iter=list.listIterator; iter.next(); iter.next(); Over and over again and after many moves of the iterator, I need to "reset" the position of the iterator. I want to ask how I can …

  6. Difference between Python's Generators and Iterators

    What is the difference between iterators and generators? Some examples for when you would use each case would be helpful.

  7. python - How to build a basic iterator? - Stack Overflow

    Iterator objects in python conform to the iterator protocol, which basically means they provide two methods: __iter__() and __next__(). The __iter__ returns the iterator object and is implicitly called at …

  8. Is it possible to merge iterators in Java? - Stack Overflow

    Aug 31, 2010 · Is it possible to merge iterators in Java? I have two iterators and I want to combine/merge them so that I could iterate though their elements in one go (in same loop) rather …

  9. Can we store unordered_map<T>::iterator? - Stack Overflow

    May 28, 2013 · Question> Can we store the iterator of unordered_map for later retrieval? Based on my understanding, the iterator will be invalidated after the insertion or deletion of an element.

  10. How to correctly implement custom iterators and const_iterators?

    Aug 27, 2010 · The reverse iterator is work for nothing, since the standard library provides a reverse-iterator adapter. And you failed to make the iterator type assignable from the const iterator.