Top "Iteration" questions

Iterations are the successive repetitions in loops such as for, foreach or while.

java foreach skip first iteration

Is there an elegant way to skip the first iteration in a Java5 foreach loop ? Example pseudo-code: for ( Car car : …

java foreach iteration skip
is the Java HashMap keySet() iteration order consistent?

I understand that the Set returned from a Map's keySet() method does not guarantee any particular order. My question is, …

java iteration hashmap hashset
How does one iterate through an unordered set in C++?

Suppose I have an unordered set unordered_set<int> my_set; myset.insert(1); myset.insert(2); myset.insert(3); How …

c++ c++11 iteration unordered-set
How to avoid StopIteration Error in python

I have a line that is pulling in variables from multiple lists and I want it to avoid the StopIteration …

python iteration stopiteration
How do I modify an array while I am iterating over it in Ruby?

I'm just learning Ruby so apologies if this is too newbie for around here, but I can't work this out …

ruby arrays iteration
Reverse Sorted Dictionary in .NET

Is there any way I can iterate backwards (in reverse) through a SortedDictionary in c#? Or is there a way …

c# .net dictionary iteration reverse
Is if(items != null) superfluous before foreach(T item in items)?

I often come across code like the following: if ( items != null) { foreach(T item in items) { //... } } Basically, the if condition …

c# iterator foreach iteration
PHP: Can I get the index in an array_map function?

I'm using a map in php like so: function func($v) { return $v * 2; } $values = array(4, 6, 3); $mapped = array_map(func, $values); …

php arrays loops dictionary iteration
Does pandas iterrows have performance issues?

I have noticed very poor performance when using iterrows from pandas. Is this something that is experienced by others? Is …

python performance pandas iteration
Why should recursion be preferred over iteration?

Iteration is more performant than recursion, right? Then why do some people opine that recursion is better (more elegant, in …

performance language-agnostic recursion iteration