Exemplo n.º 1
0
            private void shift(int target)
            {
                StackData s = stacks[(target + 1) % num_stack];

                if (s.size >= s.capacity)
                {
                    shift(target + 1);
                }
                for (int i = (s.start + s.capacity - 1) % (num_stack * default_size); s.isWithinStack(i, num_stack * default_size); i = last(i))
                {
                    buffer[i] = buffer[last(i)];
                }
                buffer[s.start] = -1;
                s.capacity--;
                s.start   = next(s.start);
                s.pointer = next(s.pointer);
            }