Iteration is the repetition of a block of statements within a computer program, usually with mutable state.

learn more… | top users | synonyms

6
votes
1answer
1k views

Missing level of technical depth (Recursive to Iterative)

I recently have given a coding test in a reputable IT company. There were three coding questions. They refused me by saying that as we felt they didn't demonstrate the level of technical depth we'...
5
votes
2answers
312 views

Integer Partition using an iterator

I tried implementing Integer Partition (enumerating all possible sets of whole numbers whose sum is a given integer). Looking at @rolfl's answer, I reasoned that with a stack data structure, we ...
10
votes
0answers
140 views

for_each for tuple-likes

I've implemented a C++14 for_each for tuple-like objects. It's similar to std::for_each in that it also returns the functor once ...
5
votes
2answers
90 views

Implementation of a dynamic list-like array

I needed to address an issue that I met with quite a bit, which has sort of a bag of data that I can easily add items and remove them, and iterate over them at any point without an issue. First thing ...
4
votes
2answers
70 views

Implementation of a list-like array

This is a follow up question for this question: Implementation of a dynamic list-like array This is an implementation of an array that behaves like a list, granting me an easy and quick way to: ...
3
votes
2answers
607 views

Parallel for loop in Java 8

This is my first attempt to provide some syntactic sugar for doing mutually independent loop iterations in parallel. Thanks to Java 8 lambdas, I can write the parallel loops in pretty elegant fashion ...
2
votes
1answer
2k views

Parallel for loop in Java 8 - follow-up

The previous and initial iteration at Parallel for loop in Java 8. Changes are as follows: ParallelLoopBody removed; ...
2
votes
1answer
104 views

lexical scope v let in scheme functions

I've been chewing through a bit of The Little Schemer and the Peano examples got me thinking about operation size and time. I got some help on making Peano Multiplication linear -- however ...