B
Bob Jenkins
I have this cute data structure that I just found a second opportunity
to use. I googled for references to it, but came up empty. I
probably just don't know its name.
The algorithm on this data structure typically has an array of
pointers, and in a loop refers to array[i % n] .. array[(i+n-1) % n],
modifies array[i % n], then increments i. I do away with i by having
an array of size 2*n, where array = array[i+n]. Then I use array2
instead of array, increment array2 instead of i, and reference
array2[0]..array2[n-1]. The loop has to remember to reset array2
whenever it walks too far, but otherwise i and %n are gone.
What's this data structure called? Where is it used?
to use. I googled for references to it, but came up empty. I
probably just don't know its name.
The algorithm on this data structure typically has an array of
pointers, and in a loop refers to array[i % n] .. array[(i+n-1) % n],
modifies array[i % n], then increments i. I do away with i by having
an array of size 2*n, where array = array[i+n]. Then I use array2
instead of array, increment array2 instead of i, and reference
array2[0]..array2[n-1]. The loop has to remember to reset array2
whenever it walks too far, but otherwise i and %n are gone.
What's this data structure called? Where is it used?