modified reverse
- Posted by rforno at tutopia.com Aug 05, 2001
- 522 views
Rob: The following modified reverse routine is simpler and, most of the times, slightly faster than the standard one. However, I noticed that the comparison between the two is affected by the type of data (integer or not, simple or compound sequence), and even it seems that the way of generating the data (by means of a single sentence or by a loop) affects the resulting timings. Any explanation for such a behavior? global function reverse1(sequence s) integer n sequence t n = length(s) t = repeat(0,n) for i = 1 to n do t[n] = s[i] n -= 1 end for return t end function