Questions tagged [treenode]

The base element of a hierarchical tree-like data structure.

Trees are hierarchical data structures that represent undirected acyclic graphs. A tree is therefore composed of connected nodes.

One specific node is the root of the tree. The root node is connected to several nodes (sometimes called children), each of these being the root of a subtree, and so-on. A node of a tree that does not have any children is called a leaf. All nodes of the tree are connected directly or indirectly to the root.

Treenodes are usually recursive datastructures.

See also:

Specific usages:

  • In .Net framework a TreeNode is a node in TreeView UI control that displays tree-like objects.
  • In Java a TreeNode is an interface that nodes of a JTree UI control that displays tree-like objects.
586 questions
7
votes
2 answers

How to copy and paste SVG node using jQuery

I have some SVG embedded into a web page and need to copy a particular SVG node (including it's children), then paste it back into the DOM. Only problem is, the SVG node doesn't appear after being pasted, which is probably because it's…
Steve
  • 2,925
  • 5
  • 18
  • 20
7
votes
1 answer

how to reload a selected node of a tree

I need to reload a tree after deleting one of the leafs of a node. The problem of reloading the entire store is, it's too slow. That's why I just want to reload a node where its leaf is deleted. I tried this.. but it says…
EagleFox
  • 1,357
  • 9
  • 32
  • 57
7
votes
3 answers

Creating a list for a Treenode

I know this must be real easy but I just can't get it to work... I am trying to make a List for extjs Tree by comparing two columns from differnt rows and putting them as a Node or a leaf accordingly. this is my sample data ListA ListB labelName …
EagleFox
  • 1,357
  • 9
  • 32
  • 57
7
votes
3 answers

How to get depth of current node in JTree?

I have a JTree with a few nodes and subnodes. When I click on a node I want to know on which depth is it (0, 1, 3). How can I know that? selected_node.getDepth(); doesn't return the depth of current node..
Primož Kralj
  • 5,534
  • 14
  • 65
  • 125
6
votes
4 answers

Problem with TreeNode.BeginEdit()

I'm using WinForms TreeView and reaction to AfterLabelEdit event. Here's the snippet of the code: if (e.Label.Contains("|")) { if (WantAutofix()) { label = e.Label.Replace('|', '_'); } else { e.CancelEdit = true; …
Migol
  • 7,465
  • 8
  • 44
  • 68
6
votes
2 answers

make a tree from a table using golang?

I want to make a tree from a table. the table is as following: OrgID OrgName parentID A001 Dept 0 -----th top A002 subDept1 A001 A003 sub_subDept A002 A006 gran_subDept A003 A004 subDept2 A001…
user3373877
  • 285
  • 1
  • 4
  • 16
5
votes
3 answers

extjs treepanel: expand() & expandChildNodes()

If I write: rootNode.expand() I can only get access to the children nodes of this rootNode, but can't get access to the grandchildren nodes of this rootNode. I have to write: rootNode.expandChildNodes() in order to acheive it. Is there another way…
Simon
  • 1,423
  • 6
  • 33
  • 44
5
votes
3 answers

how many nodes can a binary tree have at level n? Use induction to prove the answer

This is a homework and i didn't have much time to spent on it but I know some of the answer and need a little help plz i'm thinking like this assume we have: 1 node ----> Level 1 2,3 nodes ----> Level 2 3,4,5,6,7 nodes ----> level 3 4,5,6,.....,15…
Bobj-C
  • 5,487
  • 8
  • 44
  • 75
5
votes
1 answer

Extract the hierarchical structure of the nodes in a dendrogram or cluster

I would like to extract the hierarchical structure of the nodes of a dendrogram or cluster. For example in the next example: library(dendextend) dend15 <- c(1:5) %>% dist %>% hclust(method = "average") %>% as.dendrogram dend15 %>% plot The nodes…
Ruben
  • 493
  • 4
  • 17
5
votes
1 answer

How to explain TreeNode type restriction and self-type in Spark's TreeNode?

From the definition of TreeNode in Spark SQL: abstract class TreeNode[BaseType <: TreeNode[BaseType]] extends Product { self: BaseType => ... } What does it say about the subtypes of TreeNode and BaseType? What's acceptable?
expoter
  • 1,466
  • 12
  • 29
5
votes
5 answers

Find the maximum depth of a tree

I have a tree data structure with N first-level child nodes that have childs too. For example: Root Node1 Node11 Node111 Node1111 Node12 Node2 Node21 Node211 I would like to know which of the braches has the biggest depth. As in the…
Vincenzo
  • 61
  • 1
  • 3
5
votes
1 answer

ExtJS 4 - Never cache tree nodes in tree panel

I have a simple Ext.tree.Panel, which loads its data from a Ext.data.TreeStore using an ajax proxy. The default behavior when expanding a treenode seems to be: if expanded before: retrieve from cache if never expanded: retrieve from server How can…
Zurb
  • 738
  • 1
  • 5
  • 18
5
votes
3 answers

Node is partially cut off in winform TreeView

I am having issues figuring out what this issue is. I have googled around and have not found many solutions to this issue. The only "solution" I found was a hack to expand then collapse the last node. this.Nodes[this.Nodes.Count -…
Smeiff
  • 239
  • 1
  • 6
  • 16
4
votes
3 answers

Prevent drag and drop outside of the current control (TreeNodes in a TreeView)

I'm maintaining a Windows app that has multiple forms in the one window (form1, form2, form3). I'm treating the other form2 and form3 as black boxes at the moment. In form1 I have a TreeView, and I'm implementing drag and drop functionality within…
MattyG
  • 8,169
  • 5
  • 40
  • 48
4
votes
3 answers

Find the level of Deepest child Treenode

I have treenode & i would like to find the deepest child in the treenode. if there are 2 child nodes with level 11 & level 13 respectively then i need unction to return me the value 13. How can i do that ? public int FindLevel(TreeNode…
Sangram Nandkhile
  • 15,287
  • 17
  • 75
  • 111
1
2
3
39 40