Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Data structure used for directory structure?

I'm making a program which the user build directories (not in windows, in my app) and in these folders there are subfolders and so on; every folder must contain either folders or documents. What is the best data structure to use? Notice that the user may select a subfolder and search for documents in it and in its subfolders. And I don't want to limit the folders or the subfolders levels.

like image 205
Salameh Avatar asked Nov 01 '08 17:11

Salameh


People also ask

Which data structure is used for file directory?

Directory Implementation using Hash Table. An alternative data structure that can be used for directory implementation is a hash table.

What is directory structure in data structure?

In computing, a directory structure is the way an operating system arranges files that are accessible to the user. Files are typically displayed in a hierarchical tree structure.

What is a commonly used structure for the directory?

There are several ways to structure a directory. However, tree-structured directories are the most common.


1 Answers

I should recommend B+ Tree .... You can easily use indexing (page,folder etc ) and all .

B+ Tree http://commons.wikimedia.org/wiki/File:Btree.png

for more info : http://ozark.hendrix.edu/~burch/cs/340/reading/btree/index.html

like image 105
The Hun Avatar answered Oct 01 '22 19:10

The Hun