How to safely delete entries from a queue

In reply to mseyunni:

pls use hash array:int hash_array[int];

hash_array[id] = num;
an then translate to queue.