Previous | Next --- Slide 35 of 47
Back to Lecture Thumbnails
Xelblade

Shouldn't the foreach loop run from i = 0 ... N/2?

jpaulson

No. N/2 is being passed in.

stephyeung

We noted in class that this implementation is better than one implemented in, say, MATLAB. The reason being that if we abstracted how our program would work in MATLAB, we would have it first create some temporary array storing all of our values, and then have to iterate through this temp again to duplicate each value, which means we would've iterated through the array twice.