- Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathUndirectedGraph.java
More file actions
Latest commit
31 lines (25 loc) · 631 Bytes
/
Copy pathUndirectedGraph.java
File metadata and controls
31 lines (25 loc) · 631 Bytes
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
29
30
31
packagegraph;
/* See restrictions in Graph.java. */
/** Represents an undirected graph. Out edges and in edges are not
* distinguished. Likewise for successors and predecessors.
*
* @author Rafayel Mkrtchyan
*/
publicclassUndirectedGraphextendsGraphObj {
@Override
publicbooleanisDirected() {
returnfalse;
}
@Override
publicintinDegree(intv) {
returnoutDegree(v);
}
@Override
publicintpredecessor(intv, intk) {
returnsuccessor(v, k);
}
@Override
publicIteration<Integer> predecessors(intv) {
returnsuccessors(v);
}
}