开发者

Hierarchical data - Parent id or Nested set model

I'm working on a project that required categories, I used a neste开发者_高级运维d set model and it worked out well. I have another portion of the same project, however it requires a different type of hierarchy, there will only ever be a parent. So, an item can only EVER relate to one other item.

Would you say for this, using simply parent_id would be more appropriate then a full nested set model?

Thank you!


I would say it doesn't matter. I think of nested set and adjacent tree model as different data structure but the same type of hierarchical tree. I think of a ternary trie and a patricia trie. Both have a different data structure but the type trie is the same.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜