Array Representation / Memory Representation of Queue
Array Representation / Memory Representation of Queue :-
Queue are abstract data types. They are implemented either by an array or linked list. In array representation, in queue to pointers or variables front and rear are used to track the front rear of a queue. Initially all the elements of a queue are incised to (-1) to indicate an empty queue. When ever an item is inserted in the queue the rear variable or pointer is incremented by (1) to indicate the next empty cell.
When ever the item is deleted from the queue front variable or pointer is incremented by (1) to indicate the new front of the queue.![]() |
Fig - Array/Memory Representation of Queue |
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment