To be fair, this pseudo-code is by far the fastest implementation. It doesn't have the overhead of a loop, nor the expensive modulo and comparison operations.
If the question was to optimize for speed, this is exactly how I would do it (except maybe a "printf" or something similar preceding each line.
View all comments
1
u/Rikkety Jan 17 '14
To be fair, this pseudo-code is by far the fastest implementation. It doesn't have the overhead of a loop, nor the expensive modulo and comparison operations.
If the question was to optimize for speed, this is exactly how I would do it (except maybe a "printf" or something similar preceding each line.