[英]Implementing a Graph object in java
So I am attempting to create a DFS and BFS algorithm but cannot seem to get the graph object populated as I receive the error Graph object cannot be resolved to a type
. 因此,我尝试创建DFS和BFS算法,但是由于收到错误
Graph object cannot be resolved to a type
填充Graph object cannot be resolved to a type
。 Is there something I am missing when importing from the java library? 从Java库导入时,我缺少什么东西吗? As always thanks for your help.
一如既往的感谢您的帮助。
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);
import
for class Graph is missing 缺少类图的
import
Add required jars
to your classpath and build 将所需的
jars
添加到您的类路径并进行构建
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.