answersLogoWhite

0

Delete Front----

DQDELETE_FRONT(QUEUE, FRONT, REAR, ITEM)

1. [check for queue underflow]

If FRONT<0, Then: Print: "Queue is empty", and Return.

2. ITEM = QUEUE[FRONT];

3. Set FRONT = FRONT + 1.

4. Return.

Delete Rear----

DQDELETE_REAR(QUEUE, REAR, FRONT, ITEM)

1. [check for queue underflow]

If REAR<0, Then: Print: "Queue is empty", and Return.

2. ITEM = QUEUE[REAR].

3. Set REAR = REAR - 1.

4.Return.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Program to delete elements at both ends in a dequeue using c plus plus?

#include&lt;deque&gt; std::deque&lt;int&gt; deq; deq.push_back (42); deq.pop_back (); deq.push_front (0); deq.pop_front ();


Enqueue and dequeue in data structures?

The queue insert operation is known is enqueue. A queue has two ends namely REAR &amp; FRONT. After the data has been inserted in a queue ,the new element becomes REAR.The queue deletion operation is known as dequeue. The data at the front of the queue is removed .


What is the need of dequeue?

A deque, or double-ended queue, is a versatile data structure that allows insertion and deletion of elements from both ends, making it useful for various applications. It supports operations like adding or removing elements efficiently from either front or back, which is beneficial for scenarios such as implementing queues, stacks, or maintaining a sliding window over a dataset. Deques provide greater flexibility than traditional queues or stacks, enabling more complex data management and algorithm implementations.


Which one is better kruhskal's algorithm or prim's algorithm?

Both algorithms have the same efficiency and both are based on the same greedy approach. But Kruskal's algorithm is much easier to implement.


You want to delete one name on the bill?

Delete them both!


What does chameleon in hierarchical clustering algorithm mean?

Chameleon is a hierarchical clustering algorithm that merges two clusters based both on inter-connectivity and proximity


Copying and cutting are the same functions in Microsoft Word?

no both are not same if we do copy it s not delete to that place but we use cut iwill be delete no both are not same if we do copy it s not delete to that place but we use cut iwill be delete


What is booth's algorithm?

It is a powerful algorithm for signing up a number of multiplication. It generates a 2n bit product and it treats both +ve &amp; -ve number uniformly.


Calculate the Time and Space complexity for the Algorithm to add 10 numbers?

The algorithm will have both a constant time complexity and a constant space complexity: O(1)


Which algorithm was the first to be found suitable for both digital signing and encryption?

RSA


How do you search a particular element from the vector?

To search a particular element from the vector, use the find() algorithm. If the vector is sorted, you can use the binary_search() algorithm to improve efficiency. Both algorithms can be found in the &lt;algorithm&gt; header in the C++ standard library.


What are elements called that have both characteristics of both metals and nonmetals?

These elements are metalloids.