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.
630 questions
0
votes
1 answer

How to display a LinkedBinaryTree

I need to understand the best way to display my linkedBinaryTree. right noe the driver is passing in integers as elements to each node of the tree, For the toString i have tried the following snippet of code but all it returns is for instance is…
Tigh
  • 19
  • 2
  • 7
0
votes
1 answer

Need advice on how to create node class for r/b tree in java

We have been asked to implement a Red Black Tree in java, but not i'm exatcly sure how this is done. It would be really nice if anyone would comment on my node class for the r/b tree implementation. Here we go: public class RBTnode { public…
John
  • 317
  • 4
  • 19
-1
votes
1 answer

How to put XmlNodes in TreeNode without using treeview?

i already have a project with TreeNode class which creates a hierachy of nodes like treeview. Now i want to add a XML node to that treenode. In a simple way i can do it by using windows forms Treeview widget, But i don't want to use that. Is…
crazy_itgal
  • 309
  • 1
  • 9
  • 20
-1
votes
1 answer

Check how many nodes in a B-Tree are size n

Given a B-Tree, I have to look for all the nodes that are length n. However, I'm struggling to traverse with B-trees of a height greater than 1. I'm not sure how I can make my recursive call or my loop move such that I can reach the nodes at a lower…
hii
  • 11
  • 5
-1
votes
1 answer

Regarding HTML, What does it mean that "elements are part of the DOM"?

From the following paragraphs: "Elements and tags are not the same things. Tags begin or end an element in source code, whereas elements are part of the DOM, the document model for displaying the page in the browser." "The DOM (Document Object…
Andrea
  • 3
  • 2
-1
votes
1 answer

Convert JSON tree nodes into final JSON recursively

I need help to convert this json tree nodes to final json structure joining the nodes recursively. Any help is appreciated. I need a recursively function in javascript. Given below the sample input and output I needed. My Input { root: { …
nosdalg
  • 571
  • 1
  • 5
  • 23
-1
votes
1 answer

huffman tree without using priority queues

for my project i have to create a huffman tree project, but my lecturer has said that i cannot use priority queues to build it? But i dunno how to implement that. Are there any other ways i can create a huffman tree without using priority…
-1
votes
1 answer

NameError: name 'TreeNode' is not defined

from typing import Optional class Solution: def findLeaves(self,root: Optional[TreeNode]) -> list[list[int]]: def post_order(node): nonlocal lookup if not node: return 0 left_depth =…
-1
votes
1 answer

Nothing happens when I RIGHT click the Tree Node on the TreeView (Windows Form)

I am trying to create a new node when I right click on the treenode. private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Button == MouseButtons.Right) { treeView1.Nodes[0].Nodes.Add("Folder"); …
Noob69
  • 1
  • 1
-1
votes
1 answer

recursive function with dynamic treenode

I have a recursive function wich objective is scann an structure and represent that structure with treenodes. Inside my function depends the structure I'll have to create another treenode inside my treenode or just create a node. My problem is…
Damnit
  • 1
-1
votes
2 answers

How to get a list of all ancestors in a general java tree

I've got a TreeNode class that represents a node in the tree and a LinkedTree class. In this one I want to get a list with every ancestor of a node. In every node I save the value, the node of the parent and a list with all the children. Therefore I…
Lisa
  • 11
  • 1
-1
votes
1 answer

how to programmatically click a .NET 4 WinForm TreeView TreeNode

I need to programmatically click a treeview treenode so that the NodeClick event fires. I used to be able to call Select(), but with this version of .NET (4) that method has gone away. Anyone know what the new approach is? Thanks, Mike
flyfisher1952
  • 424
  • 4
  • 11
-1
votes
2 answers

Enumerate object/folder structure dynamically C#

I have a structure of folders and files which I want to read in and display in a TreeView. Both the folders and files are objects in my C# Visual Studio environment. A folder object contains: Collection of files Collection of folders The top…
-1
votes
2 answers

delphi treeview add information to every nodes

I'd like to add information to the nodes everytime I populate a Treeview. I mean for instance, when I create a ChildNode I'd like to link it with its degree of kinhsip. Maybe the property data is made for this but I don't know how to handle it.
user4877975
-1
votes
2 answers

Looping through array to add each item to a parentNode

I have the following code: TreeNode parentNode1 = new TreeNode("CONNECTING RODS"); TreeViewNav.Nodes.Add(parentNode1); string[] subNodes = { "STOCK", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R",…
Luke Rayner
  • 391
  • 6
  • 20