Queue Method

How to delete the specific index of the queue without using delete keyword?

In reply to r.srikrishnan:
I assume this was an interview question and you want to find the answer you missed. :)

See section 7.10.4 Updating a queue using assignment and unpacked array concatenation which give the equivalent concatenation operations for the methods. Note that using a method is usually more optimal for performance.

In reply to r.srikrishnan:

How to delete the specific index of the queue without using delete keyword?

Example: If you want to delete element at index 100 of ‘queue’, you can use:


int queue[$];
// Deleting element at index 100
queue = {queue[0:99], queue[101:$]}