May 2017
Intermediate to advanced
310 pages
8h 5m
English
Using a Python list to implement a queue is a good starter to get the feel of how queues work. It is completely possible for us to implement our own queue data structure by utilizing our knowledge of pointer structures.
A queue can be implemented using a doubly linked list, and insertion and deletion operations on this data structure have a time complexity of O(1).
The definition for the node class remains the same as the Node we defined when we touched on doubly linked list, The doubly linked list can be treated as a queue if it enables a FIFO kind of data access, where the first element added to the list is the first to be removed.