MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / New

Function New

graph/graph.go:16–20  ·  view source on GitHub ↗

Constructor functions for graphs (undirected by default)

(v int)

Source from the content-addressed store, hash-verified

14
15// Constructor functions for graphs (undirected by default)
16func New(v int) *Graph {
17 return &Graph{
18 vertices: v,
19 }
20}
21
22// AddVertex will add a new vertex in the graph.
23// If the vertex already exists it will do nothing.

Callers 4

TestDirectedGraphFunction · 0.70
TestUndirectedGraphFunction · 0.70
TestPrimMSTFunction · 0.70
TestBellmanfordFunction · 0.70

Calls

no outgoing calls

Tested by 4

TestDirectedGraphFunction · 0.56
TestUndirectedGraphFunction · 0.56
TestPrimMSTFunction · 0.56
TestBellmanfordFunction · 0.56