answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: What is mean by queue full and queue empty?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What does it means in computer algorithm while empty Q Q1 where Q is queue and Q1 is element of queue?

That doesn't make much sense. I guess it should be while NOT empty Q. Note that in many programming languages, the "not" is expressed with the exclamation mark. Perhaps you overlooked it... or it disappeared from the question. In that case (not empty), the meaning would be something like: while there is something in the queue (i.e., while not empty queue), process the elements in the queue (do something with the element). The statement is incomplete; instead of just "q1" it should say something like "process q1" or "q1.process()".


When is linear queue said to be empty?

linear quene said to empty when front==rear==-1 or front==rear


What is the use of insertion queue in 8086?

Maybe you mean the prefetch queue?


When can we say that a queue is full using double linked lists?

If you use a doubly-linked list to implement a queue then the queue is full whenever it is not empty. However, given that a list dynamically shrinks and expands to accommodate all the elements within it, we can never really say it is full per se because its true capacity is ultimately determined by the amount of available memory and that can vary from one moment to the next. Note that you do not need to use a doubly-linked list to implement a queue since there is no need to physically traverse a queue. We only need constant-time access to the head (for extractions) and the tail (for insertions). We still need to maintain links between the nodes, however just one link per node would suffice for this. As such, an adapted singly-linked list (also known as a forward list) would consume less memory than a doubly-linked list would. The only change we need to make is to add one pointer to keep track of the tail node. Note also that a singly-linked list generally does not maintain a count of its elements which helps improve efficiency even further. It's usually sufficient to know if the list is empty or not empty and we can easily determine that in constant-time simply by examining the head node state; if it points to null, then the list is empty otherwise it is not empty (or "full" if you prefer). The same applies to a queue; we're usually only interested in knowing if a queue actually exists before we extract the front element, and that can only be the case if there's at least one element in the queue (i.e., the queue is not empty). The actual number of elements is rarely of any importance, but we can easily adapt a singly-linked list to accommodate a count if we really needed one.


What problem is overcome by using a circular array for a static queue?

//Library File#include//Class to hold a person's dataclass person{public:int arr_time,trans_time;};//Class to implement queueclass Queue{private:person data[5]; // An array object of the person classint front,back; // 'front' and 'back' variables to point to the front value and back valueint count; //'count' counts the no. of elements present in the queuepublic:Queue() //Constructor{front=back=0;count=0;}void inqueue(int a_tym,int t_tym) // Function to add data into the queue{if(count>=5)cout

Related questions

What is circular queue operations circular queue?

A circular queue is similar to the normal queue with the difference that queue is circular queue ; that is pointer rear can point to beginning of the queue when it reaches at the end of the queue. Advantage of this type of queue is that empty location let due to deletion of elements using front pointer can again be filled using rear pointer. There are 2 conditions for queue full if queue is implemented using arrays. First condition is Front = 1 and Rear = N Second condition is Front = Rear + 1


What does it means in computer algorithm while empty Q Q1 where Q is queue and Q1 is element of queue?

That doesn't make much sense. I guess it should be while NOT empty Q. Note that in many programming languages, the "not" is expressed with the exclamation mark. Perhaps you overlooked it... or it disappeared from the question. In that case (not empty), the meaning would be something like: while there is something in the queue (i.e., while not empty queue), process the elements in the queue (do something with the element). The statement is incomplete; instead of just "q1" it should say something like "process q1" or "q1.process()".


When is linear queue said to be empty?

linear quene said to empty when front==rear==-1 or front==rear


Algorithm to delete elements at both ends in a dequeue?

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.


What does un queue mean in french?

un queue means 'a tail'


What does the British English word queue mean?

Queue = line (of people)


What is the use of insertion queue in 8086?

Maybe you mean the prefetch queue?


What is a empty glass full of water?

An empty glass full of


When can we say that a queue is full using double linked lists?

If you use a doubly-linked list to implement a queue then the queue is full whenever it is not empty. However, given that a list dynamically shrinks and expands to accommodate all the elements within it, we can never really say it is full per se because its true capacity is ultimately determined by the amount of available memory and that can vary from one moment to the next. Note that you do not need to use a doubly-linked list to implement a queue since there is no need to physically traverse a queue. We only need constant-time access to the head (for extractions) and the tail (for insertions). We still need to maintain links between the nodes, however just one link per node would suffice for this. As such, an adapted singly-linked list (also known as a forward list) would consume less memory than a doubly-linked list would. The only change we need to make is to add one pointer to keep track of the tail node. Note also that a singly-linked list generally does not maintain a count of its elements which helps improve efficiency even further. It's usually sufficient to know if the list is empty or not empty and we can easily determine that in constant-time simply by examining the head node state; if it points to null, then the list is empty otherwise it is not empty (or "full" if you prefer). The same applies to a queue; we're usually only interested in knowing if a queue actually exists before we extract the front element, and that can only be the case if there's at least one element in the queue (i.e., the queue is not empty). The actual number of elements is rarely of any importance, but we can easily adapt a singly-linked list to accommodate a count if we really needed one.


What problem is overcome by using a circular array for a static queue?

//Library File#include//Class to hold a person's dataclass person{public:int arr_time,trans_time;};//Class to implement queueclass Queue{private:person data[5]; // An array object of the person classint front,back; // 'front' and 'back' variables to point to the front value and back valueint count; //'count' counts the no. of elements present in the queuepublic:Queue() //Constructor{front=back=0;count=0;}void inqueue(int a_tym,int t_tym) // Function to add data into the queue{if(count>=5)cout


What is dynamic queue?

Dynamic queue is one that can grow to allow for more entries. àA static queue has a fixed number of slots and once they are full no more entries can be supported until one entry leaves the queue.


There are 10 glasses in a row The first five glasses are filled with water and the last five are empty How would you create a row of alternating empty and full glasses by only moving two of the glass?

Take the second and the fourth full glass, and empty the contents into the second and fourth empty glass. Put the now-empty glasses back where they were. Now the glasses alternate between full, empty, full, empty, full, empty, full, empty, full, and empty.