Total members 11894 |It is currently Fri Nov 22, 2024 4:00 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Implementing C++ priority queue.
cpp code
#include <iostream>
using std::cout;
using std::endl;

#include <queue>

int main()
{
std::priority_queue< double > priorities;

priorities.push( 3.2 );
priorities.push( 9.8 );
priorities.push( 5.4 );

cout << "Popping from priorities: ";

while ( !priorities.empty() )
{
cout << priorities.top() << ' ';
priorities.pop();
}

cout << endl;
return 0;
}

/*
Popping from priorities: 9.8 5.4 3.2

*/




_________________
Please recommend my post if you found it helpful


Author:
Beginner
User avatar Posts: 95
Have thanks: 2 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : priority queue
 Circular Queue     -  
 generic queue     -  
 Queue Header     -  
 CPU priority algorithm...     -  
 queue of objects keep track of the front and rear     -  
 task's priority and how is it used in scheduling?     -  
 cpu priority scheduling in java---codes please..     -  
 source code for SJF and priority for both preemptive C#     -  
 Implementation of FCFS, SJFS, Round Robin and priority algo     -  



Topic Tags

C++ Data Structures






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com