In reply to mseyunni:
pls use hash array:int hash_array[int];
hash_array[id] = num; an then translate to queue.