Hierarchical/tree database for directories path in filesystem

后端 未结 3 1805
暖寄归人
暖寄归人 2020-11-30 22:05

I want to store the directories (present on the disk) into a database, maintaining their hierarchical/tree structure.

Here\'s a figure:

                           


        
3条回答
  •  不思量自难忘°
    2020-11-30 22:49

    I think you should read about a method caled Modified Preorder Tree Traversal: http://www.sitepoint.com/hierarchical-data-database/

    That link discusses about two methods to storing hierarchical data into relational databases: the adjacency list model and the modified preorder tree traversal algorithm.

    The main idea of Modified Preorder Tree Traversal method is annotate all nodes with pointers to auxiliate the navigation and sub-tree selection:

提交回复
热议问题