为什么这样无法给pointer赋值,我debug看变量g.adjList[i}.firstedge明明不为null,但是整个循环下来pointer一直都是null,没有赋值成功请问这个什么回事?
Graph是我定义的图的数据结构.firstedge的类型也是EdgeNode
public static void showAll(Graph g) {
for (int i = 1;i<= g.numVertexs ; i++) {
'EdgeNode pointer = g.adjList[i].firstedge;'
while(pointer != null) {
//....
pointer = pointer.next;
}
}
}