Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PriorQ
//g++ 7.4.0 //////////////////////////////////////////////////////////////////////////// //PriorQ //this code is created by Rezaul Hoque on July 07,2022; //contact:jewelmrh@yahoo.com;Dhaka,Bangladesh;https://rezaulhoque.wordpress.com,https://hoquestake.blogspot.com //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; ///////////////////////////////////////////////////////////////////////////// #include <iostream> #include <queue> #include <string> class DePQ{ std::string city; public: DePQ(){} DePQ(std::string s){city =s; } DePQ(const DePQ& c){ city=c.city; } ~DePQ(){} std::string getC(){return city;} }; int main() { std::priority_queue<std::string> p; DePQ* a; a=new DePQ[3]; a[0]={"Sparta"}; a[1]={"Athens"}; a[2]={"Rome"}; const auto z={a[0].getC(),a[1].getC(),a[2].getC()}; for(auto n: z) p.push(n); while (p.empty()==false) { std::cout<<p.top()<<"\n"; p.pop(); } return 0; }
run
|
edit
|
history
|
help
0
NonparaSign
Updated Linked Lists - 5/10/2017 V4.0
Bitset Operators
runtime template mode processor
reverseKNode
Eratosfen conmment
Policy based smart pointer
water drop/ water land
Bez królików
segmentedSieveR