A Queue is a collection of objects that are inserted and removed using First in First out Principle(FIFO). Insertion is done at the back(Rear) of the Queue and elements are accessed and deleted from first(Front) location in the queue.
1. enqueue() : Adds element to the back of Queue. 2. dequeue() : Removes and returns the first element from the queue. 3. first() : Returns the first element of the queue without removing it. 4. size() : returns the number of elements in the Queue. 5. isEmpty() : Return True if Queue is Empty else return False. 6. printqueue() : Print all elements of the Queue.
Below is the implementation of the above mentioned Queue operations using Doubly LinkedList in Python:
Queue operations using doubly linked list queue elements are: 4->5->6->7-> first element is 4 Size of the queue is 4 After applying dequeue() two times queue elements are: 6->7-> queue is empty: False
- Priority Queue using doubly linked list
- Python | Stack using Doubly Linked List
- XOR Linked List - A Memory Efficient Doubly Linked List | Set 1
- XOR Linked List – A Memory Efficient Doubly Linked List | Set 2
- Difference between Singly linked list and Doubly linked list
- QuickSort on Doubly Linked List
- Reverse a Doubly Linked List | Set-2
- Reverse a Doubly Linked List
- Sort the biotonic doubly linked list
- Rotate Doubly linked list by N nodes
- Sort a k sorted doubly linked list
- Sort the biotonic doubly linked list | Set-2
- Find pairs with given sum in doubly linked list
- Merge Sort for Doubly Linked List
- Delete all occurrences of a given key in a doubly linked list
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.