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
- Reverse a Doubly Linked List | Set-2
- QuickSort on Doubly Linked List
- Reverse a Doubly Linked List
- Doubly Circular Linked List | Set 2 (Deletion)
- Doubly Linked List | Set 1 (Introduction and Insertion)
- Implementation of Deque using doubly linked list
- Delete all the even nodes from a Doubly Linked List
- Bubble Sort On Doubly Linked List
- Rotate Doubly linked list by N nodes
- Reverse a Doubly linked list using recursion
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.