Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary - 24BEYC01 (24beyc01)

Rating
-
Sold
-
Pages
13
Uploaded on
25-05-2025
Written in
2024/2025

queue and its types data struture

Institution
Course

Content preview

Queue

●​ Queue is a linear data structure that follows FIFO (First In First Out) Principle, so the
first element inserted is the first to be popped out.
●​ FIFO Principle states that the first element added to the Queue will be the first one to be
removed or processed. So, Queue is like a line of people waiting to purchase tickets,
where the first person in line is the first person served.




Basic Terminologies of Queue
●​ Front: Position of the entry in a queue ready to be served, that is, the first entry that will be
removed from the queue, is called the front of the queue. It is also referred as the head of the
queue.
●​ Rear: Position of the last entry in the queue, that is, the one most recently added, is called
the rear of the queue. It is also referred as the tail of the queue.
●​ Size: Size refers to the current number of elements in the queue.
●​ Capacity: Capacity refers to the maximum number of elements the queue can hold.

, Representation of Queue




Operations on Queue
1. Enqueue:
Enqueue operation adds (or stores) an element to the end of the queue.
Steps:
1.​ Check if the queue is full. If so, return an overflow error and exit.
2.​ If the queue is not full, increment the rear pointer to the next available position.
3.​ Insert the element at the rear.


2. Dequeue:
Dequeue operation removes the element at the front of the queue. The following steps are taken
to perform the dequeue operation:
1.​ Check if the queue is empty. If so, return an underflow error.
2.​ Remove the element at the front.
3.​ Increment the front pointer to the next element.


3. Peek or Front Operation:
This operation returns the element at the front end without removing it.

Written for

Institution
Course

Document information

Uploaded on
May 25, 2025
Number of pages
13
Written in
2024/2025
Type
SUMMARY

Subjects

$8.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
vrishtikkavaipavsaran

Get to know the seller

Seller avatar
vrishtikkavaipavsaran
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
11 months
Number of followers
0
Documents
7
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions