This document discusses priority queues and their implementation. It begins by defining different types of queues like simple, circular, priority, and double-ended queues. It then focuses on priority queues, explaining ascending and descending order priority queues. Various data structures for implementing priority queues are covered, including arrays, linked lists, heaps, and binary search trees. Common operations on priority queues like enqueue, dequeue, and peek are also defined. Finally, applications of priority queues in areas like CPU scheduling, graph algorithms, and data compression are mentioned.
Queue is an abstract data structure, somewhat similar to Stacks. Unlike stacks, a queue is open at both its ends. One end is always used to insert data (enqueue) and the other is used to remove data (dequeue). Queue follows First-In-First-Out methodology, i.e., the data item stored first will be accessed first.
Queue is an abstract data structure, somewhat similar to Stacks. Unlike stacks, a queue is open at both its ends. One end is always used to insert data (enqueue) and the other is used to remove data (dequeue). Queue follows First-In-First-Out methodology, i.e., the data item stored first will be accessed first.
An ordered collection of items from which items may be deleted from one end called the front and into which items may be inserted from other end called rear is known as Queue.
It is a linear data structure.
It is called the First In First Out (FIFO) list. Since in queue, the first element will be the first element out.
a. Concept and Definition✓
b. Inserting and Deleting nodes ✓
c. Linked implementation of a stack (PUSH/POP) ✓
d. Linked implementation of a queue (Insert/Remove) ✓
e. Circular List
• Stack as a circular list (PUSH/POP) ✓
• Queue as a circular list (Insert/Remove) ✓
f. Doubly Linked List (Insert/Remove) ✓
For more course related material:
https://github.com/ashim888/dataStructureAndAlgorithm/
Personal blog
www.ashimlamichhane.com.np
An ordered collection of items from which items may be deleted from one end called the front and into which items may be inserted from other end called rear is known as Queue.
It is a linear data structure.
It is called the First In First Out (FIFO) list. Since in queue, the first element will be the first element out.
a. Concept and Definition✓
b. Inserting and Deleting nodes ✓
c. Linked implementation of a stack (PUSH/POP) ✓
d. Linked implementation of a queue (Insert/Remove) ✓
e. Circular List
• Stack as a circular list (PUSH/POP) ✓
• Queue as a circular list (Insert/Remove) ✓
f. Doubly Linked List (Insert/Remove) ✓
For more course related material:
https://github.com/ashim888/dataStructureAndAlgorithm/
Personal blog
www.ashimlamichhane.com.np
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
1. GOVERNMENT ARTS COLLEGE
Melur, Madurai
By
Mr. V. VEERANAN
Roll No: P22PCS123
I M.Sc. Computer Science
PG. Department of Computer Science
Topic: Priority Queue
DATA STRUTURES AND ALGORITHMS
2. Queue
Simple Priority
Circular Deque
Enqueue-rear
Dequeue-Front
FIFO
Ex. Pipes
Last Member is
linked to the
first
Ex. Week
Predefined
Priority of
Service
Ex. high priority
Enqueue and
Dequeue
both the ends
and can remove
an item from
both the ends
Types of
Priority Queue
Implementation
of Priority Queue
Ascending
Descending
Array
Linked
List
Heap
Binary
Search
Tree
3. Priority
Ascending
Descending
Highest Priority to Lowest Number
Highest Priority to Highest Number
Implementation of Priority Queue
Array Linked List Heap
Binary Search
Tree
enqueue()
dequeue()
peek() / top()
push()
pop(0
peek() / top ()
insert()
extract Max()
remove(i)
get Max()
change
priority()
peek()
insert()
delete()
5. Table of the Content
S.No. Topic
1 Queue & Types of Queue
2 Simple Queue
3 Circular Queue
4 Priority Queue
5 Double Ended Queue (Deque)
6 Types of Priority Queue
7 Ascending Order Priority Queue
8 Descending Order Priority Queue
9 Implementation of Priority Queue
10 Implement Priority Queue Using Array
11 Implement Priority Queue Using Linked List
12 Implement Priority Queue Using Heap
13 Implement Priority Queue Using Binary Search Tree
14 Priority Queue Applications
6. Queues
In computer science, a queue is a collection of entities that
are maintained in a sequence and can be modified by the
addition of entities at one end of the sequence and the
removal of entities from the other end of the sequence
In this article, we’ll learn four types of queues with their
applications. Understand them one-by-one with an
illustration.
Types of Queues
Simple Queue
Circular Queue
Priority Queue
Double Ended Queue (Deque)
8. Simple Queue
• A simple queue is the most basic queue. In this queue, the
enqueue operation takes place at the rear, while the dequeue
operation takes place at the front.
• Its applications are process scheduling, disk scheduling,
memory management, IO buffer, pipes, call center phone
systems and interrupt handling.
9. Circular Queue
A circular queue is a special case of a simple queue in
which the last member is linked to the first. As a result, a circle-
like structure is formed.
The last node is connected to the first node.
Also known as a Ring Buffer as the nodes are connected end
to end.
Insertion takes place at the front of the queue and deletion at
the end of the queue.
Application of circular queue: Insertion of days in a week.
10. Priority Queue
• A priority queue is a special kind of queue in which each
item has a predefined priority of service.
• In this queue, the enqueue operation takes place at the rear in
the order of arrival of the items, while the dequeue operation
takes place at the front based on the priority of the items.
• That is to say that an item with a high priority will be
dequeued before an item with a low priority.
11. Priority Queue (Continue)
In the case, when two or more items have the same priority,
then they’ll be dequeued in the order of their arrival. Hence,
it may or may not strictly follow the FIFO rule:
It’s used in interrupt handling, Prim’s algorithm, Dijkstra’s
algorithm, A* search algorithm, heap sort, and Huffman
code generation.
12. Double-Ended Queue (Deque)
A deque is also a special type of queue. In this queue, the
enqueue and dequeue operations take place at both front
and rear. That means, we can insert an item at both the ends
and can remove an item from both the ends. Thus, it may or
may not adhere to the FIFO order:
13. Types of Priority Queue
A priority queue is of two types:
Ascending Order Priority Queue
Descending Order Priority Queue
14. Ascending Order Priority Queue
An ascending order priority queue gives the highest priority
to the lower number in that queue.
For example, you have six numbers in the priority queue that
are 4, 8, 12, 45, 35, 20. Firstly, you will arrange these numbers
in ascending order.
The new list is as follows: 4, 8, 12, 20. 35, 45. In this list, 4 is the
smallest number.
Hence, the ascending order priority queue treats number 4 as
the highest priority.
15. Ascending Order Priority Queue
Example
In the above table, 4 has the highest priority, and 45 has the
lowest priority.
4 8 12 20 35 45
16. Descending Order Priority Queue
A descending order priority queue gives the highest priority
to the highest number in that queue.
For example, you have six numbers in the priority queue that
are 4, 8, 12, 45, 35, 20. Firstly, you will arrange these numbers
in ascending order.
The new list is as follows: 45, 35, 20, 12, 8, 4. In this list, 45 is
the highest number. Hence, the descending order priority
queue treats number 45 as the highest priority.
17. Descending Order Priority Queue
In the above table, 4 has the lowest priority, and 45 has the
highest priority.
45 35 20 12 8 4
18. Implement Priority Queue
Priority queue can be implemented using the following data
structures:
Arrays
Linked list
Heap data structure
Binary search tree
19. Implement Priority Queue Using Array
A simple implementation is to use an array of the following
structure.
struct item
{
int item;
int priority;
}
20. Implement Priority Queue Using Array
• enqueue(): This function is used to insert new data into the
queue.
• dequeue(): This function removes the element with the
highest priority from the queue.
• peek()/top(): This function is used to get the highest priority
element in the queue without removing it from the queue.
Link: https://www.geeksforgeeks.org/priority-queue-using-
array-in-c/
Arrays enqueue() dequeue() peek()
Time
Complexity
O(1) O(n) O(n)
21. Implement Priority Queue Using Linked List
push(): This function is used to insert new data into the
queue.
pop(): This function removes the element with the highest
priority from the queue.
peek() / top(): This function is used to get the highest priority
element in the queue without removing it from the queue.
Linked List push() pop() peek()
Time
Complexity
O(n) O(1) O(1)
22. Implement Priority Queue Using Heaps
insert(p): Inserts a new element with priority p.
extractMax(): Extracts an element with maximum priority.
remove(i): Removes an element pointed by an iterator i.
getMax(): Returns an element with maximum priority.
changePriority(i, p): Changes the priority of an element
pointed by i to p.
Binary Heap insert() remove() peek()
Time
Complexity
O(log n) O(log n) O(1)
23. Implement Priority Queue Using
Binary Search Tree
A Self-Balancing Binary Search Tree like AVL Tree, Red-
Black Tree, etc. can also be used to implement a priority
queue.
Operations like peek(), insert() and delete() can be performed
using BST.
Binary Search
Tree
peek() insert() delete()
Time
Complexity
O(1) O(log n) O(log n)
24. Priority Queue Applications
CPU Scheduling
Graph algorithms like Dijkstra’s shortest path algorithm,
Prim’s Minimum Spanning Tree, etc.
Stack Implementation
All queue applications where priority is involved.
Data compression in Huffman code
Event-driven simulation such as customers waiting in a
queue.
Finding Kth largest/smallest element.