//Dijkstra
MinHeap<Edge<Weight>> heap(G.Vertexs());
from[s] = new Edge<Weight>(s,s,Weight());
Edge<Weight> e ;
heap.insrtelement(*from[s]);
while(!heap.isEmpty()){
e = heap.extractMin();
int v = e.W();
class Graph::adjIterator adj(v,G);
for(Edge<Weight> *it = adj.begin(); !adj.end(); it = adj.next() ){
int w = it->other(v);
老师,对于marked数组标记,您给的答案我又认真思考了下,但是还是感觉在优先队列下可以不需要marked标记,我实现了下:
//Dijkstra
MinHeap<Edge<Weight>> heap(G.Vertexs());
from[s] = new Edge<Weight>(s,s,Weight());
Edge<Weight> e ;
heap.insrtelement(*from[s]);
while(!heap.isEmpty()){
e = heap.extractMin();
int v = e.W()