-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraph.java
28 lines (23 loc) · 829 Bytes
/
Graph.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// C343 Fall 2020
//
// a simple interface for graphs
import java.util.LinkedList;
public interface Graph {
public void init();
public int length();
public void setVertices(String[] nodes);
public void addVertex(String node);
public void setEdge(int v1, int v2, int weight);
public void setEdge(String v1, String v2, int weight);
public void setVisited(int v);
public boolean ifVisited(int v);
// new for Problem Set 11:
public LinkedList<Integer> getNeighbors(int v);
public int getWeight(int v, int u);
public void clearWalk();
public void walk(String order);
public void DFS(int s); // depth first
public void BFS(int s); // breath first
public void display(); // display information
public void displayEnum(); // display vertex enumeration
}