SlideShare a Scribd company logo
1 of 10
DATA STRUCTURES USING C
(NCS-301)
SUBMITTED BY : MRS. SWETA SINGH
ASSISTANT PROFESSOR(CSE)
JIT BARABANKI(UP.)
UNIT - 2
STACKS
STACKS
• IT IS AN ORDERED GROUP OF HOMOGENEOUS ITEMS OF ELEMENTS. ELEMENTS ARE
ADDED TO AND REMOVED FROM THE TOP OF THE STACK (THE MOST RECENTLY ADDED
ITEMS ARE AT THE TOP OF THE STACK). THE LAST ELEMENT TO BE ADDED IS THE FIRST TO
BE REMOVED (LIFO: LAST IN, FIRST OUT).
• ONE END, CALLED TOP OF THE STACK. THE ELEMENTS ARE REMOVED IN REVERSE ORDER
OF THAT IN WHICH THEY WERE INSERTED INTO THE STACK .
STACK OPERATIONS
THESE ARE TWO BASIC OPERATIONS ASSOCIATED WITH STACK:
PUSH() IS THE TERM USED TO INSERT/ADD AN ELEMENT INTO A STACK.
POP() IS THE TERM USED TO DELETE/REMOVE AN ELEMENT FROM A STACK.
ALGORITHM FOR PUSH AND POP
CONVERT Q: A+( B * C – ( D / E ^ F ) * G ) * H INTO POSTFIX FORM SHOWING STACK STATUS .
NOW ADD “)” AT THE END OF EXPRESSION A+( B * C – ( D / E ^ F ) * G ) * H ) AND ALSO PUSH
A “(“ ON STACK.
RECURSION
• RECURSION IS A PROGRAMMING TECHNIQUE THAT ALLOWS THE PROGRAMMER TO
EXPRESS OPERATIONS IN TERMS OF THEMSELVES. IN C, THIS TAKES THE FORM OF A
FUNCTION THAT CALLS ITSELF.
• A USEFUL WAY TO THINK OF RECURSIVE FUNCTIONS IS TO IMAGINE THEM AS A PROCESS
BEING PERFORMED WHERE ONE OF THE INSTRUCTIONS IS TO "REPEAT THE PROCESS".
• A SIMPLE EXAMPLE OF RECURSION WOULD BE:
VOID RECURSE()
{
RECURSE(); /* FUNCTION CALLS ITSELF */
}
INT MAIN()
{
RECURSE(); /* SETS OFF THE RECURSION */
RETURN 0;
QUEUE
• A QUEUE IS A LINEAR LIST OF ELEMENTS IN WHICH DELETION CAN TAKE PLACE ONLY
AT ONE END, CALLED THE FRONT, AND INSERTIONS CAN TAKE PLACE ONLY AT THE
OTHER END, CALLED THE REAR.
• THE TERM “FRONT” AND “REAR” ARE USED IN DESCRIBING A LINEAR LIST ONLY WHEN IT
IS IMPLEMENTED AS A QUEUE. QUEUE IS ALSO CALLED FIRST-IN-FIRST-OUT (FIFO)
LISTS.
• SINCE THE FIRST ELEMENT IN A QUEUE WILL BE THE FIRST ELEMENT OUT OF THE
QUEUE. IN OTHER WORDS, THE ORDER IN WHICH ELEMENTS ENTERS A QUEUE IS THE
ORDER IN WHICH THEY LEAVE.
• THERE ARE MAIN TWO WAYS TO IMPLEMENT A QUEUE :
1. CIRCULAR QUEUE USING ARRAY 2. LINKED STRUCTURES (POINTERS)
PRIMARY QUEUE OPERATIONS: ENQUEUE: INSERT AN ELEMENT AT THE REAR OF THE
DEQUEUE (OR) DEQUE (DOUBLE ENDED
QUEUE)
• DEQUEUE IS A DATA STRUCTURE IN WHICH ELEMENTS MAY BE ADDED TO OR DELETED FROM
THE FRONT OR THE REAR.
• LIKE AN ORDINARY QUEUE, A DOUBLE-ENDED QUEUE IS A DATA STRUCTURE IT SUPPORTS THE
FOLLOWING OPERATIONS: ENQ_FRONT, ENQ BACK, DEQ_FRONT, DEQ_BACK, AND EMPTY.
DEQUEUE CAN BE BEHAVE LIKE A QUEUE BY USING ONLY ENQ_FRONT AND DEQ_FRONT , AND
BEHAVES LIKE A STACK BY USING ONLY ENQ_FRONT AND DEQ_REAR. .
• THE DEQUEUE IS REPRESENTED AS FOLLOWS.
• DEQUEUE CAN BE REPRESENTED IN TWO WAYS THEY ARE 1) INPUT RESTRICTED DEQUEUE
2) OUTPUT RESTRICTED DEQUEUE
PRIORITY QUEUE
• PRIORITY QUEUE IS A LINEAR DATA STRUCTURE. IT IS HAVING A LIST OF ITEMS IN WHICH EACH
ITEM HAS ASSOCIATED PRIORITY. IT WORKS ON A PRINCIPLE ADD AN ELEMENT TO THE QUEUE
WITH AN ASSOCIATED PRIORITY AND REMOVE THE ELEMENT FROM THE QUEUE THAT HAS THE
HIGHEST PRIORITY.
• IN GENERAL DIFFERENT ITEMS MAY HAVE DIFFERENT PRIORITIES. IN THIS QUEUE HIGHEST
OR THE LOWEST PRIORITY ITEM ARE INSERTED IN RANDOM ORDER.
• IT IS POSSIBLE TO DELETE AN ELEMENT FROM A PRIORITY QUEUE IN ORDER OF THEIR
PRIORITIES STARTING WITH THE HIGHEST PRIORITY.
• OPERATIONS ON PRIORITY QUEUE:
A PRIORITY QUEUE MUST AT LEAST SUPPORT THE FOLLOWING OPERATIONS:
• INSERT_WITH_PRIORITY: ADD AN ELEMENT TO THE QUEUE WITH AN ASSOCIATED PRIORITY.
• PULL_HIGHEST_PRIORITY_ELEMENT: REMOVE THE ELEMENT FROM THE QUEUE THAT HAS
THE HIGHEST PRIORITY, AND RETURN IT. THIS IS ALSO KNOWN AS "POP_ELEMENT(OFF)",
"GET_MAXIMUM_ELEMENT" OR "GET_FRONT(MOST)_ELEMENT" .
THANK YOU

More Related Content

What's hot

Sorting Algorithms
Sorting AlgorithmsSorting Algorithms
Sorting Algorithms
multimedia9
 

What's hot (20)

Data structure
Data structureData structure
Data structure
 
Insertion sort
Insertion sortInsertion sort
Insertion sort
 
Quick Sort
Quick SortQuick Sort
Quick Sort
 
Searching & Sorting Algorithms
Searching & Sorting AlgorithmsSearching & Sorting Algorithms
Searching & Sorting Algorithms
 
3.8 quick sort
3.8 quick sort3.8 quick sort
3.8 quick sort
 
Marge Sort
Marge SortMarge Sort
Marge Sort
 
Merge sort
Merge sortMerge sort
Merge sort
 
Insertion sort
Insertion sortInsertion sort
Insertion sort
 
Merge sort algorithm power point presentation
Merge sort algorithm power point presentationMerge sort algorithm power point presentation
Merge sort algorithm power point presentation
 
Sorting algorithms
Sorting algorithmsSorting algorithms
Sorting algorithms
 
Quicksort Algorithm..simply defined through animations..!!
Quicksort Algorithm..simply defined through animations..!!Quicksort Algorithm..simply defined through animations..!!
Quicksort Algorithm..simply defined through animations..!!
 
Shellshort ppt
Shellshort pptShellshort ppt
Shellshort ppt
 
Quick sort
Quick sortQuick sort
Quick sort
 
IRJET- Dynamic Implementation of Stack using Single Linked List
IRJET- Dynamic Implementation of Stack using Single Linked ListIRJET- Dynamic Implementation of Stack using Single Linked List
IRJET- Dynamic Implementation of Stack using Single Linked List
 
Sorting Algorithms
Sorting AlgorithmsSorting Algorithms
Sorting Algorithms
 
Sorting Seminar Presentation by Ashin Guha Majumder
Sorting Seminar Presentation by Ashin Guha MajumderSorting Seminar Presentation by Ashin Guha Majumder
Sorting Seminar Presentation by Ashin Guha Majumder
 
Sorting
SortingSorting
Sorting
 
Shell sorting
Shell sortingShell sorting
Shell sorting
 
Data Structure (MC501)
Data Structure (MC501)Data Structure (MC501)
Data Structure (MC501)
 
Hub 102 - Lesson 5 - Algorithm: Sorting & Searching
Hub 102 - Lesson 5 - Algorithm: Sorting & SearchingHub 102 - Lesson 5 - Algorithm: Sorting & Searching
Hub 102 - Lesson 5 - Algorithm: Sorting & Searching
 

Similar to Unit 2 dsuc(Stacks and Queue)

Fundamentalsofdatastructures 110501104205-phpapp02
Fundamentalsofdatastructures 110501104205-phpapp02Fundamentalsofdatastructures 110501104205-phpapp02
Fundamentalsofdatastructures 110501104205-phpapp02
Getachew Ganfur
 
Data structure lecture 9
Data structure lecture 9Data structure lecture 9
Data structure lecture 9
Kumar
 

Similar to Unit 2 dsuc(Stacks and Queue) (20)

Data structures
Data structuresData structures
Data structures
 
Stacks IN DATA STRUCTURES
Stacks IN DATA STRUCTURESStacks IN DATA STRUCTURES
Stacks IN DATA STRUCTURES
 
Stack and Queue.pptx
Stack and Queue.pptxStack and Queue.pptx
Stack and Queue.pptx
 
Ds stack & queue
Ds   stack & queueDs   stack & queue
Ds stack & queue
 
Data Structures
Data StructuresData Structures
Data Structures
 
stack.pptx
stack.pptxstack.pptx
stack.pptx
 
queue.pptx
queue.pptxqueue.pptx
queue.pptx
 
Data Structures 2
Data Structures 2Data Structures 2
Data Structures 2
 
Queues
Queues Queues
Queues
 
Stack in Sata Structure
Stack in Sata StructureStack in Sata Structure
Stack in Sata Structure
 
Fundamentalsofdatastructures 110501104205-phpapp02
Fundamentalsofdatastructures 110501104205-phpapp02Fundamentalsofdatastructures 110501104205-phpapp02
Fundamentalsofdatastructures 110501104205-phpapp02
 
1. 2 Singly Linked List
1. 2 Singly Linked List1. 2 Singly Linked List
1. 2 Singly Linked List
 
2.1 STACK & QUEUE ADTS
2.1 STACK & QUEUE ADTS2.1 STACK & QUEUE ADTS
2.1 STACK & QUEUE ADTS
 
sweetu stacks.pdf
sweetu stacks.pdfsweetu stacks.pdf
sweetu stacks.pdf
 
Ist year Msc,2nd sem module1
Ist year Msc,2nd sem module1Ist year Msc,2nd sem module1
Ist year Msc,2nd sem module1
 
10994103.ppt
10994103.ppt10994103.ppt
10994103.ppt
 
Data structure lecture 9
Data structure lecture 9Data structure lecture 9
Data structure lecture 9
 
Mca ii dfs u-3 linklist,stack,queue
Mca ii dfs u-3 linklist,stack,queueMca ii dfs u-3 linklist,stack,queue
Mca ii dfs u-3 linklist,stack,queue
 
Bsc cs ii dfs u-2 linklist,stack,queue
Bsc cs ii  dfs u-2 linklist,stack,queueBsc cs ii  dfs u-2 linklist,stack,queue
Bsc cs ii dfs u-2 linklist,stack,queue
 
Bca ii dfs u-2 linklist,stack,queue
Bca ii  dfs u-2 linklist,stack,queueBca ii  dfs u-2 linklist,stack,queue
Bca ii dfs u-2 linklist,stack,queue
 

More from Sweta Singh

More from Sweta Singh (6)

Unit 5 dbms
Unit 5 dbmsUnit 5 dbms
Unit 5 dbms
 
Unit 3 dbms
Unit 3 dbmsUnit 3 dbms
Unit 3 dbms
 
Unit 1 dbms
Unit 1 dbmsUnit 1 dbms
Unit 1 dbms
 
Unit 4 dbms
Unit 4 dbmsUnit 4 dbms
Unit 4 dbms
 
Unit 4 dsuc
Unit 4 dsucUnit 4 dsuc
Unit 4 dsuc
 
Unit 3 dsuc
Unit 3 dsucUnit 3 dsuc
Unit 3 dsuc
 

Recently uploaded

1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 

Recently uploaded (20)

Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 

Unit 2 dsuc(Stacks and Queue)

  • 1. DATA STRUCTURES USING C (NCS-301) SUBMITTED BY : MRS. SWETA SINGH ASSISTANT PROFESSOR(CSE) JIT BARABANKI(UP.)
  • 3. STACKS • IT IS AN ORDERED GROUP OF HOMOGENEOUS ITEMS OF ELEMENTS. ELEMENTS ARE ADDED TO AND REMOVED FROM THE TOP OF THE STACK (THE MOST RECENTLY ADDED ITEMS ARE AT THE TOP OF THE STACK). THE LAST ELEMENT TO BE ADDED IS THE FIRST TO BE REMOVED (LIFO: LAST IN, FIRST OUT). • ONE END, CALLED TOP OF THE STACK. THE ELEMENTS ARE REMOVED IN REVERSE ORDER OF THAT IN WHICH THEY WERE INSERTED INTO THE STACK . STACK OPERATIONS THESE ARE TWO BASIC OPERATIONS ASSOCIATED WITH STACK: PUSH() IS THE TERM USED TO INSERT/ADD AN ELEMENT INTO A STACK. POP() IS THE TERM USED TO DELETE/REMOVE AN ELEMENT FROM A STACK.
  • 5. CONVERT Q: A+( B * C – ( D / E ^ F ) * G ) * H INTO POSTFIX FORM SHOWING STACK STATUS . NOW ADD “)” AT THE END OF EXPRESSION A+( B * C – ( D / E ^ F ) * G ) * H ) AND ALSO PUSH A “(“ ON STACK.
  • 6. RECURSION • RECURSION IS A PROGRAMMING TECHNIQUE THAT ALLOWS THE PROGRAMMER TO EXPRESS OPERATIONS IN TERMS OF THEMSELVES. IN C, THIS TAKES THE FORM OF A FUNCTION THAT CALLS ITSELF. • A USEFUL WAY TO THINK OF RECURSIVE FUNCTIONS IS TO IMAGINE THEM AS A PROCESS BEING PERFORMED WHERE ONE OF THE INSTRUCTIONS IS TO "REPEAT THE PROCESS". • A SIMPLE EXAMPLE OF RECURSION WOULD BE: VOID RECURSE() { RECURSE(); /* FUNCTION CALLS ITSELF */ } INT MAIN() { RECURSE(); /* SETS OFF THE RECURSION */ RETURN 0;
  • 7. QUEUE • A QUEUE IS A LINEAR LIST OF ELEMENTS IN WHICH DELETION CAN TAKE PLACE ONLY AT ONE END, CALLED THE FRONT, AND INSERTIONS CAN TAKE PLACE ONLY AT THE OTHER END, CALLED THE REAR. • THE TERM “FRONT” AND “REAR” ARE USED IN DESCRIBING A LINEAR LIST ONLY WHEN IT IS IMPLEMENTED AS A QUEUE. QUEUE IS ALSO CALLED FIRST-IN-FIRST-OUT (FIFO) LISTS. • SINCE THE FIRST ELEMENT IN A QUEUE WILL BE THE FIRST ELEMENT OUT OF THE QUEUE. IN OTHER WORDS, THE ORDER IN WHICH ELEMENTS ENTERS A QUEUE IS THE ORDER IN WHICH THEY LEAVE. • THERE ARE MAIN TWO WAYS TO IMPLEMENT A QUEUE : 1. CIRCULAR QUEUE USING ARRAY 2. LINKED STRUCTURES (POINTERS) PRIMARY QUEUE OPERATIONS: ENQUEUE: INSERT AN ELEMENT AT THE REAR OF THE
  • 8. DEQUEUE (OR) DEQUE (DOUBLE ENDED QUEUE) • DEQUEUE IS A DATA STRUCTURE IN WHICH ELEMENTS MAY BE ADDED TO OR DELETED FROM THE FRONT OR THE REAR. • LIKE AN ORDINARY QUEUE, A DOUBLE-ENDED QUEUE IS A DATA STRUCTURE IT SUPPORTS THE FOLLOWING OPERATIONS: ENQ_FRONT, ENQ BACK, DEQ_FRONT, DEQ_BACK, AND EMPTY. DEQUEUE CAN BE BEHAVE LIKE A QUEUE BY USING ONLY ENQ_FRONT AND DEQ_FRONT , AND BEHAVES LIKE A STACK BY USING ONLY ENQ_FRONT AND DEQ_REAR. . • THE DEQUEUE IS REPRESENTED AS FOLLOWS. • DEQUEUE CAN BE REPRESENTED IN TWO WAYS THEY ARE 1) INPUT RESTRICTED DEQUEUE 2) OUTPUT RESTRICTED DEQUEUE
  • 9. PRIORITY QUEUE • PRIORITY QUEUE IS A LINEAR DATA STRUCTURE. IT IS HAVING A LIST OF ITEMS IN WHICH EACH ITEM HAS ASSOCIATED PRIORITY. IT WORKS ON A PRINCIPLE ADD AN ELEMENT TO THE QUEUE WITH AN ASSOCIATED PRIORITY AND REMOVE THE ELEMENT FROM THE QUEUE THAT HAS THE HIGHEST PRIORITY. • IN GENERAL DIFFERENT ITEMS MAY HAVE DIFFERENT PRIORITIES. IN THIS QUEUE HIGHEST OR THE LOWEST PRIORITY ITEM ARE INSERTED IN RANDOM ORDER. • IT IS POSSIBLE TO DELETE AN ELEMENT FROM A PRIORITY QUEUE IN ORDER OF THEIR PRIORITIES STARTING WITH THE HIGHEST PRIORITY. • OPERATIONS ON PRIORITY QUEUE: A PRIORITY QUEUE MUST AT LEAST SUPPORT THE FOLLOWING OPERATIONS: • INSERT_WITH_PRIORITY: ADD AN ELEMENT TO THE QUEUE WITH AN ASSOCIATED PRIORITY. • PULL_HIGHEST_PRIORITY_ELEMENT: REMOVE THE ELEMENT FROM THE QUEUE THAT HAS THE HIGHEST PRIORITY, AND RETURN IT. THIS IS ALSO KNOWN AS "POP_ELEMENT(OFF)", "GET_MAXIMUM_ELEMENT" OR "GET_FRONT(MOST)_ELEMENT" .