# Priority Queue in Data Structure: Characteristics, Types & Implementation

It is an abstract data type that provides a way to maintain the dataset. The “normal” queue follows a pattern of first-in-first-out. It dequeues elements in the same order followed at the time of insertion operation.

### Introduction

The priority queue in the data structure is an extension of the “normal” queue. It is an abstract data type that contains a group of items. It is like the “normal” queue except that the dequeuing elements follow a priority order. The priority order dequeues those items first that have the highest priority. This blog will give you a deeper understanding of the priority queue and its implementation in the C programming language.

### What is a Priority Queue?

It is an abstract data type that provides a way to maintain the dataset. The “normal” queue follows a pattern of first-in-first-out. It dequeues elements in the same order followed at the time of insertion operation. However, the element order in a priority queue depends on the element’s priority in that queue. The priority queue moves the highest priority elements at the beginning of the priority queue and the lowest priority elements at the back of the priority queue.

It supports only those elements that are comparable. Hence, a priority queue in the data structure arranges the elements in either ascending or descending order.

You can think of a priority queue as several patients waiting in line at a hospital. Here, the situation of the patient defines the priority order. The patient with the most severe injury would be the first in the queue.

### What are the Characteristics of a Priority Queue?

A queue is termed as a priority queue if it has the following characteristics:

• Each item has some priority associated with it.
• An item with the highest priority is moved at the front and deleted first.
• If two elements share the same priority value, then the priority queue follows the first-in-first-out principle for de queue operation.

## How To Build A Data Science Career In 2021

In Conversation With Dr Suman Sanyal, NIIT University,he shares his insights on how universities can contribute to this highly promising sector and what aspirants can do to build a successful data science career.

## Data Science Course in Bangalore | Data Science Training Bangalore - 360DigiTMG

Avail The Data Science Courses in Bangalore and Kick Start Your Career as a Successful Data Scientist in Bangalore within 4 months. Classroom/Online Data Science Course in Bangalore with Placements or Money Back.