Page 184 - DCAP201_FUNDAMENTALS_OF_DATA_STRUCTURES
P. 184
Unit 10: Queues
q->head = NULL; Notes
else
q->tail->right = NULL;
return info;
}
}
Task Analyze the use of dequeue.
Self Assessment
Fill in the blanks:
13. ............................... is an abstract data type similar to queue, where addition and deletion of
elements are allowed at both the ends.
14. Double ended queues are implemented with ...............................
15. A doubly link list can traverse in both the directions as it has two ...............................
10.6 Summary
The rule followed in a queue is that elements are added at the rear and come off of the front
of the queue.
Queue has two ends. One is front from where the elements can be deleted and the other if
rear to where the elements can be added.
The stack and the queue differ only in the position where the elements can be added or
deleted.
The basic element of a linked list is a “record” structure of at least two fields. The object
that holds the data and refers to the next element in the list is called a node.
Multiqueue is a data structure where multiple queues are maintained. This type of data
structures are used for process scheduling.
In a circular queue, front will point to one position less to the first element anti-clock wise.
Linked list representation of a circular queue is more efficient as it uses space more
efficiently, of course with the extra cost of storing the pointers.
A priority queue is a collection of elements where each element is assigned a priority.
Dequeue (a double ended queue) is an abstract data type similar to queue, where addition
and deletion of elements are allowed at both the ends.
10.7 Keywords
Circular Queue: A circular queue is one in which the insertion of new element is done at the very
first location of the queue if the last location of the queue is full.
Dequeue: Dequeue (a double ended queue) is an abstract data type similar to queue, where
addition and deletion of elements are allowed at both the ends.
LOVELY PROFESSIONAL UNIVERSITY 177