More answers

You wouldn't use an array to implement either a stack or a queue. By their nature, queues and stacks are variable length, thus are better suited to linked lists which can dynamically expand and contract.

In both cases, a singly-linked list suffices, where each element points to the next element and the last element points to NULL.

A stack is a last in, first out structure (LIFO structure), where all insertions and extractions occur at the head of the list. Therefore you only need to maintain a pointer to the head of the list.

A queue is a first in, first out structure (FIFO structure), where all insertions occur at the tail while all extractions occur at the head. Therefore you need to maintain two pointers, one at the head and one at the tail.

The head and tail pointers are required to permit constant time access to the head and tail of the list.

Priority queues are a variation on the standard queue, such that elements are prioritised. This is achieved by giving each element a weighted value and sorting by that value. Lower values have higher priority than larger values, thus you must traverse the list until you locate an element with a greater weight than the new element, and insert the new element in front of the greater element. Insertions of this type are not constant time (they are linear time), however if the number of weights is finite, the number of insertion points are also finite, therefore separate pointers can be maintained in an array thus permitting constant time access to each insertion point.

Q: How can you use the link lists as queue?

Write your answer...

Submit

Still have questions?

Continue Learning about Engineering

Maybe you mean the prefetch queue?

Circular queue have less memory consuption as compared to linear queue because while doing insertion after deletion operation it allocate an extra space the first remaining vacant but in circular queue the first is used as it comes immediate after the last.

Add weights to the elements of the queue and use an algorithm to sort the queue every time an element is added.

Ready queue contain all the jobs that are ready to execute.so the job queue and the ready queue are one and the same.

The queue is a linear data structure where operations of insertion and deletion are performed at separate ends also known as front and rear. Queue is a FIFO structure that is first in first out. Following are the types of queue: Linear queue Circular queue Priority queue Double ended queue ( or deque )

Related questions

The queue is the the concept involved in Algorithms where you use stack, queue and lists to store the different data items e.g people waiting for the bus at bus stop the first in queue will enter first this is called FIFO (first in first out).......

the barber's favorite braid is the queue

Maybe you mean the prefetch queue?

Example 1: I am standing in the ATM queue Example 2: Please be in queue

Circular queue have less memory consuption as compared to linear queue because while doing insertion after deletion operation it allocate an extra space the first remaining vacant but in circular queue the first is used as it comes immediate after the last.

It varies - according to which system is in use. The related link to Wikipedia lists the uplink & downlink frequencies.

I'm using SErocket link lists and can highly recommend them - serocket.net/linklist/

To unqueue from the (random) battleground and arena queue, simply hit the "H" key, which will take you to the PvP screen. On the second tab, there should be a button at the bottom reading "Leave Queue". Pressing this will remove you from the queue. It is the same button (now: Enter Queue) which you use to enter the queue in the first place.

Add weights to the elements of the queue and use an algorithm to sort the queue every time an element is added.

Queue is a data structure which is based on FIFO that is first in first out. Following are the types of queue: Linear queue Circular queue Priority queue Double ended queue ( or deque )

circular queue

Queues is the plural of queue.