Questions tagged [tree-structure]

110 questions
67
votes
8 answers

How to store directory / hierarchy / tree structure in the database?

How do i store a directory / hierarchy / tree structure in the database? Namely MSSQL Server. @olavk: Doesn't look like you've seen my own answer. The way i use is way better than recursive queries :) p.p.s. This is the way to go!
roman m
  • 26,012
  • 31
  • 101
  • 133
37
votes
11 answers

Optimized SQL for tree structures

How would you get tree-structured data from a database with the best performance? For example, say you have a folder-hierarchy in a database. Where the folder-database-row has ID, Name and ParentID columns. Would you use a special algorithm to get…
Seb Nilsson
  • 26,200
  • 30
  • 103
  • 130
18
votes
2 answers

Recursive search on a collection in MongoDB

I have a list of documents in MongoDB with tree structure, where Model Tree Structures with Parent References pattern used. I want a single aggregation query which returns ancestor list(till the root), given the 'name' property. Structure: { …
RaR
  • 3,075
  • 3
  • 23
  • 48
12
votes
1 answer

Creating a new Folder with given path

I'm wondering if any of you have created a function to create a folder within a given path. For Example: NewFolder = ['/projects/Resources/backup_Folder']
Victor Aguilar
  • 139
  • 1
  • 1
  • 6
11
votes
7 answers

Regex for tree structures?

Are there regular expression equivalents for searching and modifying tree structures? Concise mini-languages (like perl regex) are what I am looking for. Here is an example that might clarify what I am looking for.
JSN
  • 1,247
  • 1
  • 11
  • 12
10
votes
1 answer

Where does scikit-learn hold the decision labels of each leaf node in its tree structure?

I have trained a random forest model using scikit-learn and now I want to save its tree structures in a text file so I can use it elsewhere. According to this link a tree object consist of a number of parallel arrays each one hold some information…
whoAmI
  • 358
  • 4
  • 16
8
votes
2 answers

Tools to visualize an HTML document tree (DOM tree)

I want to visualize the document structure of a HTML website. What I would like to have is something like this: Are there any known tools that do this and where the results can be saved as a bitmap file?
Benny Code
  • 51,456
  • 28
  • 233
  • 198
7
votes
1 answer

Django CMS Multi-Level Dropdown Menu

Im kinda new to Django CMS and im trying my best to avoid asking, but this one drives me crazy. I made a Wiki app with a Topic, and Category model. I hooked it to a Site on my CMS and added it to my Menu. Now i would like to be able to show all…
Patrik
  • 440
  • 3
  • 16
6
votes
2 answers

Sencha Touch 2: Insert into TreeStore/NestedList

I'm using a NestedList with a underlying TreeStore. Now I want to add items to the NestedList as leafs. How can I do this? Currently my code (Controller, onAddButtonTapped) looks like this: var store = Ext.getStore('menuStore'); var…
Mahatma_Fatal_Error
  • 720
  • 1
  • 10
  • 26
5
votes
0 answers

Multiple parents in typeorm tree structure?

I have an application that uses Materialized Path to map a folder structure. Now I want to change it so that it is possible to link folders logically in multiple places (so a folder can have multiple parents). Is this possible with TypeORM? I've…
MOE
  • 769
  • 6
  • 19
5
votes
2 answers

How to filter children in tree structure in Tabulator?

I tried callingsetFilter function on my Tabulator tree structure, in order to filter out items. It seems to only filter out top parents. Any idea how to make this work for any level (any children or parents)? http://tabulator.info/docs/4.1/tree…
konichiwa
  • 532
  • 1
  • 5
  • 23
5
votes
2 answers

Parsing a directory structure in Java

I have to parse a set of directories given in the following text file: # Note: The root folder's parent is labelled as "?" # Assume all directory has different name # A,? B,A C,A D,C E,C F,C G,F The above file, depicts the directory structure…
Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
4
votes
2 answers

Create Object in Every Loop Iteration

I am using z80 navigation control that's built-in and here is the link for demonstration: Z80 Navigation Menu If anyone see the control, it has an object to create menus like parent menus and under it, child menus. Something like the…
AT-2017
  • 3,114
  • 3
  • 23
  • 39
4
votes
2 answers

MongoDB $graphLookup get children all levels deep - nested result

As presented in https://www.slideshare.net/mongodb/webinar-working-with-graph-data-in-mongodb, slide 50 it is possible to use $graphLookup on a View in order to get a 2 levels deep tree-structure in nested format. I have a MongoDB collection with…
kmandalas
  • 418
  • 1
  • 5
  • 17
4
votes
1 answer

Traverse upto leaf node iOS in Tree Structure TableView

I am stuck at the point where I want to delete the particular Row Object from table but It is dynamic tree structure means object can be created, deleted, reordered, etc at any time using all the Table methods. Tree Structure is dynamic so How to…
krunal
  • 452
  • 3
  • 11
1
2 3 4 5 6 7 8