डीक्यू (Dequeue) ऑपरेशन- डाटा तत्त्व को क्यू से हटाने का काम दो भागों में किया जाता है। एक उस डाटा तत्त्व को एक्सेस करना जहाँ पॉइंटर पॉइंट कर रहा हो और दूसरा उसको वहाँ से हटाना।
निम्नलिखित स्टेप्स से डीक्यू ऑपरेशन परफॉर्म किया जाता है-
Step 1 – heck if the queue is empty.
Step 2 – If the queue is empty, produce underflow error and exit.
Step 3 – If the queue is not empty, access the data where front is pointing.
Step 4 – Increment front pointer to point to the next available data element.
Step 5 – Return success.
डीक्यू (Dequeue) ऑपरेशन के लिए एल्गोरिथ्यम
procedure dequeue
if queue is empty
return underflow
end if
data = queue[front]
front ← front+1
return true
end procedure
डीक्यू (Dequeue) ऑपरेशन का C भाषा में इम्पलीमेंटेशन
int dequeue ()
{
if(isempty())
return 0;
int data = queue[front];
front = front +1;
return data;
}