Questions tagged [iteration]

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

9 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
268 views

Solve alphametics puzzles in non-brute-force, iterative manner

The goal: Trying to optimize solution for the alphametics problem on exercism. From the question text: Alphametics is a puzzle where letters in words are replaced with numbers. For example ...
3
votes
0answers
18 views

IDL code for minimum distance calculation

I made a program in IDL for performing a minimum distance classification on multispectral satellite data. This is what my main function looks like: ...
3
votes
0answers
958 views

C++11 generator implementation emulating Python's yield keyword

C++11's range-based loops allow convenient and easy iteration over containers, but what about more complicated iterations such as tree traversal? Usually this involves a lot of boilerplate code and ...
3
votes
0answers
267 views

Print the nodes of binary tree column-wise, using recursion and iteration

I am trying to code for both recursive and iterative approach to a problem. Below is a recursive code to print the nodes of binarytree column wise. Basically I have count of root as 0 and if I move ...
2
votes
0answers
42 views

Speed up iteration for large dataset in python

I'm trying to parse data into a csv prior to a bulk transaction into Neo4j. I'm using vast amounts of data in the relationships and wondered if anyone could help in speeding up the transactions below....
2
votes
0answers
708 views

Nested loops with linear array

i have found this article on how to loop through multi-dimensional arrays quickly. http://nadeausoftware.com/articles/2012/06/c_c_tip_how_loop_through_multi_dimensional_arrays_quickly I am using ...
2
votes
0answers
467 views

Efficient Sets and Maps with Treaps

I wrote up a Treap implementation to serve as the base class for a bunch of augmented data structures (interval sets, plane (2D) sets, order statistic trees), replacing my RB-tree base. Some ...
2
votes
0answers
32 views

Iterative procedure to get 3D coordinates from distance constraints

Imagine you have a series of n points randomly generated in a box in 3D space. You also have a list of distance bounds, e.g. points 5 and 3 should be between 1.0 and 2.0 Angstroms apart. There are ...
1
vote
0answers
103 views

Parallel for loop in Java - follow-up 2

The previous iteration at Parallel for loop in Java 8 - follow-up. The changes are as follows: MyTask is removed. Synchronization removed. Now the user is assumed ...