fork download
  1. #include <iostream>
  2. #include <queue>
  3. using namespace std;
  4.  
  5. struct Node {
  6. char data;
  7. Node* next;
  8. Node(char c, struct Node* nptr = nullptr)
  9. : data(c), next(nptr) {}
  10. };
  11.  
  12. template <class T>
  13. struct NodeCmp {
  14. bool operator()(const T& lhs, const T& rhs) const {
  15. return lhs->data > rhs->data;
  16. }
  17. };
  18.  
  19. int main() {
  20. priority_queue<Node*, vector<Node*>, NodeCmp<Node*>> PQ;
  21.  
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
Standard output is empty