Showing posts from October, 2018

DS & A(Queue)

In this chapter, our topic of discussion will be the "Queue" Data Structure. But, before we get started, I would recommend you to read the previous chapters on Data Structures & Algorithms (especially the chapters on Array List, Linked List, Array Stack, and Linked Stack), that is in case it's your first time visiting my blog. Queue: Just like Stacks, Queues also are a restricted version of List but with a few minor differences compared to Stack. The following are some of the notable characteristics of a Queue:Data can only be inserted from the rear/back. Data insertion is referred to as ENQUEUE.Data can only be deleted from the front. Data deletion is referred to as DEQUEUE.Alternatively, ENQUEUE and DEQUEUE should always be executed on the opposite ends of the Queue.A Queue follows the FIFO(First In First Out)principle.The first and the last elements are referred to as FRONT and REAR respectively.

Visual Representation: Array-Based Queue: Pointer-Based(Linked) Queue: So…

Share on Social Media