663 questions
1
vote
1
answer
40
views
How can I get array output instead of memory location when printing TreeNode?
I am looking at solutions of LeetCode problem 108. Convert Sorted Array to Binary Search Tree:
Given an integer array nums where the elements are sorted in ascending order, convert it to a height-...
0
votes
1
answer
223
views
Creating a balanced BST in Python
I'm trying a implement a complete BST tree, currently I have only created a balanced tree. The idea is to move all the leaves from the balance tree to the left of the left subtree to create a complete ...
0
votes
2
answers
202
views
How to flatten a deep tree using LINQ Flatten()
I have a generic type tree class as follows:
public class TreeNode<T>
{
private readonly T _data;
private readonly TreeNode<T> _parent;
private readonly List<TreeNode<T&...
0
votes
2
answers
142
views
WinForm TreeView nodes are empty despite having a DataSource to object-relational list
In my Telerik WinForms application, I'm able to bind a TreeView to a Well object in my application through object-relational binding as such:
this.wellTreeView = new RadTreeView();
BindingList<...
0
votes
1
answer
231
views
TTreeView: how to check/uncheck ONLY children from a TTreeNode?
Windows 10, Delphi 11.
I want to set .Checked only for children of a single TTreeNode with checkboxes. This is the default behavior in TreeViews. But the following code also selects all siblings (on ...
8
votes
4
answers
12k
views
I keep getting the error Condition "!is_inside_tree()" is true. Returning: Transform3D()
When the player clicks I am trying to pass the position and direction of the camera3D (which is in the player scene) to the world scene through a signal to spawn a bullet with that direction and ...
-1
votes
1
answer
87
views
Partykit CTREE question: How to subset observations within each terminal node (including variables not part of CTREE)
I would like a bit of help with my code. This is my first time posting, so please excuse the length.
Overview: I have conducted a CTREE analysis to identify certain intersections associated with a ...
0
votes
1
answer
135
views
how can I wait for the treenode to be fully expended
envirement:("@angular/core": "~7.1.0","angular-tree-component": "^8.0.1")
The problem is that i'm filtering through the node children but for some nodes the ...
-1
votes
1
answer
54
views
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 ...
0
votes
1
answer
80
views
Check if BST node has a sibling
I am trying to check if a node has a sibling using a recursive method, but it seems that my method doesn't go into the tree besides the first two children. So in this example, if I want to check if 6 ...
-1
votes
1
answer
72
views
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 ...
-1
votes
1
answer
216
views
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 ...
0
votes
1
answer
55
views
How do i sort a treeview in c# alphabetically but if it begins with W put that on top
Here is my code. I am using the sort method on the treeview but it sorts alphabetically, i want it to put any nodes beginning with w on top
public int Compare(object thisObj, object otherObj)
...
0
votes
2
answers
161
views
Is a single node after dividing a graph still considered a subset?
For example:
enter image description here
Dividing between A and B:
enter image description here
Would DAC and B be considered two subsets?
I am trying to create two subsets from an initial graph of 4 ...
-1
votes
1
answer
568
views
huffman tree without using priority queues [closed]
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 ...
0
votes
1
answer
40
views
Size of Binary Tree: wrong result when submitting code to online judge
I was trying to solve GeeksForGeeks problem Size of Binary Tree:
Given a binary tree of size N, you have to count number of nodes in it. For example, count of nodes in below tree is 4.
1
/ ...
0
votes
1
answer
1k
views
Oracle GL tree hierarchy
This is the code:
SELECT
'FXE_I_823' AS KEY,
listagg(ftn.pk1_start_value || '|' || ffvv.description, '|')
within GROUP (ORDER BY DEPTH) "TREE_CODE"
FROM
fnd_tree_node ftn,
...
1
vote
1
answer
71
views
How to stop Treenode text from being overwitten?
I am having problems where the text displayed for my treenodes is being replaced by a reference to the class I am storing in the tag property.
I have a simple form I have built using the form designer ...
0
votes
1
answer
138
views
Asking how to insert a new node to BST? Python
I am doing my practice, and the practice request create DSATreeNode and DSABinarySearchTree classes. The DSATreeNode is working fine, but when I use the function of insertRec. The insert function will ...
1
vote
0
answers
32
views
color tree Node according to database C# code
I'm writing asp.net code(web form ) with treeVeiw tags Here I'm added tage treeVeiw with ParentNodeStyle ,leafNodestyle,images ,Hovernodestyle like following code :
<asp:TreeView runat="...
-2
votes
1
answer
253
views
WPF C# - Bind tab selection to treeView selection
How do I bind a tabItem IsSelected property to a treeView Node selection via index or reference?
I want to be able to click on a treenode that will auto select a tabItem within a tabControl
0
votes
1
answer
1k
views
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:
...
0
votes
0
answers
183
views
ASP.NET TreeNode selecting
I made a treeview in my .aspx page and code behind user can add TreeNode through the button.
The problem is, I can select only one treenode but the next one I can't click / select.
Should I handle ...
0
votes
1
answer
283
views
What does it mean for a node to have a negative height in a binary tree?
I am looking at this code which defines the height function, which returns the height of the given TreeNode in a binary tree. I don't understand why it should return a value of -1? What does it mean ...
2
votes
1
answer
545
views
Was there a change from PrimeFaces 10.0.0 to 11.0.0 that made TreeNode into a Raw Type?
Now, when I define a TreeNode List such as:
List node = otherNode.getChildren();
I get two warnings.
For the left side: "TreeNode is a raw type. References to generic type TreeNode should be ...
-1
votes
1
answer
95
views
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)
{
...
0
votes
0
answers
133
views
NHibernate MismatchedTreeNodeException
I have a DB handling app in which I came across a problem while updating many to many relation's objects. I have a table Devices and a table Admittances that are connected with one another with a ...
0
votes
0
answers
265
views
Read data from text file given in a Tree format
I am trying to read the data from a text file given in a tree format.
A sample of the text file looks like this,
['972651', '80080680482123777', '0.0']->['10678072', '80080680482123777', '1.8']
['...
0
votes
3
answers
2k
views
Find Tree Node in SQL
Hi there recently one sql question were asked in Uber which was really interesting and little bit hard as well.
The question is as below
Table: Tree
+-------------+------+
| Column Name | Type |
+-----...
1
vote
2
answers
893
views
Does a TreeMap change ordering dynamically?
Let's say I put in an entry in to my map which holds an object as a key:
treeNode.put(someObject,someValue);
then some time later I get that entry, and change the object so that now if resorted it ...
0
votes
1
answer
620
views
How to owner draw a TreeView Node to show two lines of text
I am trying to figure out a way to use the StringFormat class to add new line to a given TreeNode text. For example, the string ID1:123456, ID2:789000, can be split by comma and insert a newline in ...
0
votes
0
answers
482
views
Post order Successor in a threaded binary tree
I have snippets of my code that should return the address of both the inorder and preorder successor of node alpha in a Double Threaded Binary Tree
I am stuck with how to make a procedure for the ...
0
votes
0
answers
139
views
JTree node messes up after importing from JSON file
Currently, I am writing a java program that will try to scan a computer and present the memory component as a JTree like this Tree and work flow. The scan happens in two phases. In the first phase it ...
2
votes
1
answer
471
views
Sum of all children nodes values in a specific range
I am trying to sum the all children values from its node between a specific range from its root node.
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Program {...
0
votes
1
answer
640
views
how to return a list of nodes whose value are greater than a specific number
I'm trying to find all the nodes whose data is greater than the value using recursion. I learned from someone else that I should use Breadth-First Search but I'm still new to this algorithm. I've ...
2
votes
0
answers
477
views
How do I paste multiple [sub-]nodes into CherryTree?
Using CherryTree from Giuseppe Penone, Version 0.99.45.
I want to copy a text list of node names and past it (from the clipboard) into CherryTree as a list of sub-nodes under the selected node.
...
-2
votes
2
answers
163
views
What does Type * foo() mean/return?
I am implementing a Binary Search Tree. And it so happens one of my sources have a function written such that:
Node * BST_Insert(Node *root, int val)
{
//Body
}
I already know that a pointer is a ...
0
votes
0
answers
429
views
How to count file size
This method need to return a size of all files from directory and file size. To determine file size use fileSize = tree.data.length();, but when i want to count size of all files (files in directory ...
0
votes
1
answer
3k
views
C# - Find a specific node or subnode of a treeview control
I have a problem with the TreeView control in WinForm. The thing is, I need to automate the process of inserting nodes by using a while loop and using the node previously inserted in the control as ...
0
votes
1
answer
80
views
Unsure why this particular test case does not work for merging binary trees
CS Student here practicing on leetcode.
I've been given the following problem:
No idea if this code is any good or not, would appreciate some feedback there as well, but here is what I worked out:
...
0
votes
1
answer
395
views
How do I add a TreeNode ToolTip delay in c#
I found that normal tooltips let you add InitialShowDelay. When adding a tooltip in a treeview, I can't seem to edit this delay.
TreeNode node;
node.ToolTipText = "Hello";
/* One suggestion ...
0
votes
1
answer
184
views
TreeView - Event handling from Custom TreeNode
I am attempting to create a TreeView control with custom TreeNode. Each TreeNode has an associated custom type/category which defines the appearance (eg, colour) and a specific right-click context ...
0
votes
1
answer
299
views
Tree view control, get next available node name from the max value
I'm working on a method that gives the next available node name if a node with the specified name exists. But the idea is that the method gives the next one from the max value, for example:
If I add ...
0
votes
1
answer
800
views
Maximum number of nodes in a Huffman tree
For the purpose of memory performance optimizations while building a Huffman tree I would like to pre-allocate the necessary memory for its nodes.
Is there a way to calculate the maximum number of ...
-2
votes
1
answer
421
views
I have to put the hyphen on the parent node when a child is selected with primeng
This is Typescript
//DICHIARATIONS AN CODE
Ngonint-->
ngOnInit() {
if(this.title === "Create"){
this.dataProfilo = {}
this.dataProfilo.function = [];
...
0
votes
1
answer
68
views
Why I am seeing None data after deleting the smallest or largest item from Binary Search Tree?
I have a binary search tree. I have written basic insert, delete, traversal of the full tree and find its maximum and minimum node of the tree but I have trouble with finding maximum and minimum node ...
1
vote
1
answer
757
views
AttributeError: type object 'BSTNode' has no attribute 'left'
I was trying to construct a Binary Search Tree in python.
This is my node class:
class BSTNode:
def __init__(self,val):
self.left = None
self.right = None
self.val = val
This class ...
1
vote
1
answer
555
views
Primefaces Treenode How to select father node only?
Is there anyways to select father node without its children in Primefaces treenode?
I am using Primefaces treenode to display a product category, but not all products belong to children categories. ...
1
vote
0
answers
220
views
wrong number of template arguments(1, should be 2). Can anyone take a look?
I'm creating a dictionary using BST as derive class from the dictionary class. since I'm using template, I encounter one error of which I figure out the reason but can't solve it. can anyone figure ...
1
vote
1
answer
551
views
Object to Tree for TreeTable, group by twice Typescript / JavaScript
I am trying to convert a list into a tree structure for a primeng TreeTable.
[{pk:"1", corpID:"1234", date: "31/03/21", rela:"4325", price:"20.00"},
{...