Questions tagged [tree-structure]

110 questions
1
vote
1 answer

Parse flat array into a nested structure (tree)

For example, I'd like to parse the following array: var array1 = ["a.b.c.d", "a.e.f.g", "a.h", "a.i.j", "a.b.k"] into: var json1 = { "node": "a", "leaf": false, "children": [{ "node": "b", "leaf": false, …
luthien
  • 1,285
  • 3
  • 15
  • 26
1
vote
0 answers

ObjectListView - TreeListView expand different lists in tree structure

I try to expand multiple lists in my tree structure. Let's say I have the following classes. I have the class Product, which contains a list with its children. This is my actual tree structure. class Product { int prodID; string…
1
vote
0 answers

How to go about not getting certain data from a JOIN

First off this is a project management database I'm messing with. So I have 3 things I want to JOIN together a planning_entity and two subqueries. These subqueries get apart of a tree structure. The parts of the tree structure I want are Project,…
apkisbossin
  • 336
  • 1
  • 3
  • 16
1
vote
1 answer

Cannot read property "match" (nestedSortable)

I have a tree structure that I'm trying to sort with a jQuery nestedSortable plugin. Here you can see my code and a working example: $(document).ready(function(){ $('.sortable').nestedSortable({ handle: 'div', items: 'li', …
Sam
  • 472
  • 1
  • 8
  • 19
1
vote
1 answer

Understanding HeirarchyId Node a little better

I am looking at HeirarchyId in SQLserver 2008 and referring to the following document: http://www.codeproject.com/Tips/740553/Hierarchy-ID-in-SQL-Server As far as I understand a statement like INSERT INTO H (Node, ID, Name) VALUES…
Lost
  • 12,007
  • 32
  • 121
  • 193
1
vote
0 answers

In Ext js, how to store the tree's nodes' info (i.e. tree structure) on drop operation (i.e. after changing the tree structure)?

I'm new at Ext JS. I have created a tree structure and I am loading the tree store using ajax with the json data from .php file. When I drag any node and drop on some other node, this functionality visibly works properly, but after refreshing the…
yogi
  • 11
  • 2
1
vote
2 answers

sql query get all children and grandchildren

What is proper way to get all children and grandchildren or n-generation children. for children and grandchildren my query is like below: SELECT e1.ID, e1.LName + ', '+e1.FName FROM lstEmp e1 INNER JOIN lstEmp e2 ON e1.Supervisor = e2.ID Where…
Ag Long
  • 75
  • 2
  • 8
1
vote
1 answer

What is the ideal Grails class domain for this tree structure

I'm developing a website that need categories with sub categories. My current domain class is: package com.abc class Category { String title String description Category parent static hasMany = [children: Category, listing:…
1
vote
2 answers

Python TreeStructure (parent and children) class, children gets appended to it's own children?

I'm coding a TreeStructure (TS) class, which lets me create parent and child objects, which are linked to each other. Every TS -object has m_parent attribute, which is controlled with parent property, and also they have children list, which holds in…
user1632861
0
votes
2 answers

Creating a tree datastructure - different approach

In the passed I've asked many questions about tree datastructures, but it seems I didn't take it to the correct manner in C++. In the way I wrote the datastructure I couldn't think of a single manner on how to have an "end" or "begin" iterator. As…
paul23
  • 8,799
  • 12
  • 66
  • 149
0
votes
1 answer

Rails 3, MySQL, tree structure

I need to one of my project use a tree structure. I found this link and I tried it to use. My table structure looks this: id user_id parent_id lft rgt When I try to create a root, so I will do this: save_tree = TreeStruct.create!(:user_id =>…
user984621
  • 46,344
  • 73
  • 224
  • 412
0
votes
0 answers

Level of operators in a Tree structure made by two columns

so I'm working in the Ab Initio GDE and got a specific set of IDs in different columns, that if I put them together should equal the levels of a tree structure. the two columns are as follows: enter image description here Both IDs describe operators…
Ene
  • 1
0
votes
1 answer

Turn raw gedcom-format string into structured json

I'm working on a Gedcom parser. The raw data for it looks like this: 0 HEAD 1 GEDC 2 VERS 5.5.5 2 FORM LINEAGE-LINKED 3 VERS 5.5.5 1 CHAR UTF-8 1 SOUR GS 2 NAME GEDCOM Specification 2 VERS 5.5.5 2 CORP gedcom.org 3 ADDR 4 CITY LEIDEN 3 WWW…
0
votes
0 answers

how do i Join a List of DataFrames with each other based on two indexes (parent index and child index)

I have a List of DataFrames. Each DataFrame has a parent index field and a child index field, both indexes contain UUIDs. The first df has no parent and the index is 0 but all the other dfs have a parent. Some dfs with multiple rows might not have a…
Michael
  • 161
  • 1
  • 9
0
votes
1 answer

make object structure recursive structure with same keys in javascript

Currently, I have this object const path ={ "posts": { "backend": { "a.mdx": "./pages/posts/backend/a.mdx" }, "frontend": {}, "retrospective": { "b.mdx":…
togong
  • 125
  • 1
  • 5