Less than 1 minute
Home > @hz-9/algorithm > Graph > removeVertex
Graph.removeVertex() method
Remove a vertex from the graph.
从图中删除顶点。
Signature:
removeVertex(vertex: T | Vertice<T>): boolean;Parameters
Parameter | Type | Description |
|---|---|---|
vertex | T | Vertice<T> | The vertex to remove. |
Returns:
boolean
Whether the vertex is successfully removed. Returns false if the vertex doesn't exist or if it is being used by any edges.