Skip to main content

Posts

Showing posts with the label Queue

Queue implementation using Linked List

Queue is a data structure that serves as a collection of elements. It follows the policy of FIFO i.e first in first out. To follow this it has 2 principle functions Enqueue   function is used to add an element to the rear of the queue Dequeue function is used to remove an element from the queue Linked list is a simple linear data structure formed by collection of data elements called nodes. Each node consists of a data element and link field.The data field consists of element and link field consists of address of next element. To know more about Queue Data Structure click here To know more about Linked List click here To view Simple Linked List implementation click here      Now inorder to implement Queue using linked list we need to implement enqueue and dequeue operation in Linked List. Enqueue and dequeue can be implemented by using other already implemented functions of Linked List like addToEnd and remove functions. Here is ...