【问题标题】:What is a data structure called where a node can assosiate to many other nodes?一个节点可以与许多其他节点关联的数据结构是什么?
【发布时间】:2023-03-16 09:47:01
【问题描述】:

将是一个数据结构的通用名称,其中一个节点可以有许多父节点和许多子节点,对象本身将是自引用的......

MySQL 表可能如下所示:

NodeTbl
  id: integer

NodeJoinTbl
  source_node_id: integer
  target_node_id: integer

Persistent Ruby 类可能如下所示:

class Node < ActiveRecord::Base
  has_and_belongs_to_many :nodes
end

【问题讨论】:

    标签: data-structures terminology


    【解决方案1】:

    图表?..................................

    【讨论】:

    • +1 更具体地说是“有向图”,因为源和目标之间存在区别
    • 是的,我猜父母和孩子之间没有区别?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多