in this video the code I an able to understand the priority queue format
Not able to understand the format of priority queue
hello @toshitvarshney11
that priority queue defined in the video is acting as a min heap . we are using it to get minimum weight every time .
this is standard syntax for min heap
priority_queue< datatype , vector< datatype > , greater < datatype > > pq;
now replace datatype with pair <int ,int> u will get the priority queue that is defined in the video.
we are using pair<int,int> as datype because we want to store two things .1-> weight/distance 2-> vertex.