Randomize dynamic array with unique values

In reply to megamind:

Actually it is better to use queue, to handle element addition.