mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2026-03-13 08:51:02 +08:00
Add getNeighbors method to Graph.
This commit is contained in:
@@ -25,6 +25,13 @@ export default class Graph {
|
||||
return this.vertices[vertexKey];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {GraphVertex} vertex
|
||||
*/
|
||||
getNeighbors(vertex) {
|
||||
return vertex.getNeighbors();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {GraphEdge} edge
|
||||
* @returns {Graph}
|
||||
|
||||
Reference in New Issue
Block a user