Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Ruby
Vertex = Struct.new(:x, :y, :z)
Graph = Struct.new(:vertex, :neighbours)

v = Vertex.new(1, 2, 3)
neighbours = [ Vertex.new(2, 3, 4), Vertex.new(4, 5, 6) ]
graph = Graph.new(v, neighbours)
struct Vertex
{
	float x, y, z;
	Vertex* [] adjacentVertices;
}

New implementation...