Datová struktura “queue”

{“https:\/\/www.jdoodle.com\/a\/cC3?format=text”:”#include <iostream>\n#include <queue>\nusing namespace std;\n\nint main() {\n queue<int> q;\n q.push(1);\n q.push(2);\n q.push(3);\n \n while(! q.empty()) {\n cout << q.front() << ";";\n q.pop();\n }\n}”,”https:\/\/www.jdoodle.com\/a\/cC4?format=text”:”#include <iostream>\n#include <queue>\nusing namespace std;\n\nstruct Employee {\n string name;\n int wage;\n \n Employee(string n, int w): name(n), wage(w) {}\n};\n\nostream& operator<<(ostream& os, const Employee& e) {\n os << "Jmeno: " << e.name << ", plat: " << e.wage << endl;\n return os;\n}\n\nint main() {\n queue<Employee> q;\n q.emplace("Ale\u0161", 20000);\n q.emplace("Monika", 30000);\n q.emplace("Jaroslav", 15000);\n \n while(! q.empty()) {\n cout << q.front();\n q.pop();\n }\n return 0;\n}\n”}


Datová struktura “queue”
Ohodnoťte tento článek