|
|
|
|
|
by martyalain
2733 days ago
|
|
" You copy rather than use strided accesses. " I don't understand "strided accesses". « Plagiarism is stealing, copying is create. » I just translated the code in the lambdatalk language and added missing examples, something that I consider mandatory. |
|
Check this out (javascript):
For arrays with power of two sizes, these perform the same permutation (but fail differently for non power of two sizes). Note that, with permute1, we effectively iterate over the entire input log2(n) times, so this is an O(nlogn) algorithm!edit: also, i think i may have misunderstood the relationship between your js version and your lambdatalk version. They seem to be the same to me?