[STL]priority_queue, pair, struct
By 찜질방 | 2017년 9월 26일 |
내가 만든 구조체를 가지고 우선순위 큐 구현할 때... typedef struct NODE{ ... ...} NODE, *pNode; std::priority_queue< std::pair<double, NODE *>, std::vector<std::pair<double, NODE *> >, greater<std::pair<double, NODE *> > > priority_queue_node; NODE *a;a = new NODE;a->...; std::pair<double, NODE *> tempNODE; priority_queue_node.push(tempNODE); tempNODE = priority