所以我试图创建一个DFS和BFS算法,但是当我收到错误Graph object cannot be resolved to a type
时似乎无法填充图形对象。从java库导入时有什么我缺少的东西吗?一如既往地感谢您的帮助。
import java.util.*;
public class Maze {
public static void main(String[] args)
{
Graph myGraph= new Graph(); // <- error resides here.
myGraph.addconnection(0, 3);
myGraph.addconnection(0, 5);
myGraph.addconnection(1, 4);
myGraph.addconnection(2, 3);
myGraph.addconnection(5, 4);
myGraph.addconnection(5, 7);
myGraph.addconnection(6, 7);
myGraph.addconnection(7, 8);
myGraph.addconnection(8, 9);
myGraph.addconnection(9, 10);
myGraph.addconnection(11, 3);
答案 0 :(得分:1)
import
缺少类缺少
将必需的jars
添加到您的类路径并构建