Kris
Kris

Reputation: 19948

What is a data structure called where a node can assosiate to many other nodes?

Would is the generic name for a data structure where a node can have many parent and many children, the object itself would be self-referential...

The MySQL tables might look like this:

NodeTbl
  id: integer

NodeJoinTbl
  source_node_id: integer
  target_node_id: integer

A Persistent Ruby Class might looks like this:

class Node < ActiveRecord::Base
  has_and_belongs_to_many :nodes
end

Upvotes: 1

Views: 63

Answers (1)

James
James

Reputation: 9278

A graph?.................................

Upvotes: 4

Related Questions