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. 回答1: This is what I do: Every record in the database has two fields: ID and ParentID. IDs are 4-5