We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12
Queue Data Structure
A queue is a container of objects (a linear collection) that are inserted and
removed according to the first-in first-out (FIFO) principle (Abstract Data type). Queue can be created by using Array and link list
The difference between stacks and queues is in removing. In a stack we
remove the item the most recently added; in a queue, we remove the item the least recently added. Types of Queue Data Structure •Simple Queue •Circular Queue •Priority Queue •Doubly Ended Queue •Input Restricted Deque •Output Restricted Deque Operation of Queue Data Structure •Create a Queue •Insert a element in a Queue (Enqueue) •Delete a element in a Queue (Dequeue) •Traversing elements
Enqueue means to insert an item into the back of the queue,
dequeue means removing the front item Thank You! Link List DS A linked list is a linear data structure, in which the elements are not stored at contiguous memory locations. The elements in a linked list are linked using pointers.
In simple words, a linked list consists of nodes where each node
contains a data field and a reference(link) to the next node in the list. Link List DS (types) Link List DS Operation
Create – Create the link list
Insertion − Adds an element at the beginning of the list. Deletion − Deletes an element at the beginning of the list. Display − Displays the complete list. Search − Searches an element using the given key. Link List DS Operation Create – Create the link list struct Node { int data; struct Node* next; }; Link List DS Operation Insertion Link List DS Operation Deletion Link List DS Operation Display 1.Define a node current which initially points to the head of the list. 2.Traverse through the list till current points to null. 3.Display each node by making current to point to node next to it in each iteration. Link List DS Operation Search