Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
70 views

I have a self-referencing Laravel model for a category tree. Each node can have children, and I want to delete a node together with all of its descendants. My relationship looks like this: public ...
bcExpt1123's user avatar
-4 votes
0 answers
38 views

This post is followup to Nested dict with parent/child relation,, which was closed due to duplication. However, after 3 days....I will give it a try again. To problem is following. I am trying to sort ...
erotski's user avatar
  • 43
2 votes
0 answers
117 views

I understand that starting from Java 8, HashMap converts buckets with high collision into red-black trees to improve worst-case performance from O(n) to O(log n). However, when I intentionally create ...
Manan Vyas's user avatar
0 votes
1 answer
47 views

I'm a bit puzzled by the following jax behavior (version 0.6.2). Normally, if I broadcast a prefix tree into a structure tree, the value of the prefix is broadcast into the structure: out_tree = jax....
Ben's user avatar
  • 613
0 votes
1 answer
89 views

My SwiftData app contains of two main model classes forming a tree, Folder (root and sub) and Entry (leaf), which I show in a List - this all works as expected. To add new items, I use AddWindow, ...
koen's user avatar
  • 5,920
Advice
0 votes
2 replies
35 views

For one of my projects, I have been working on a pattern matching engine that determines if a pattern tree can match to a target tree. The trees are rooted, the children are unordered, and the nodes ...
user499369's user avatar
10 votes
1 answer
675 views

I’m looking at the classic “is binary tree balanced” problem (LeetCode 110 style): Given a binary tree, determine if it is height-balanced. A binary tree is height-balanced if for every node, the ...
FluidMechanics Potential Flows's user avatar
Advice
0 votes
4 replies
87 views

Explain where to use AVL tree and where to use Redblack ,explain the key concepts in these trees like the time complexity and how to implement it.where these trees are used in real world applications....
Sujeet A R's user avatar
0 votes
4 answers
175 views

I was attempting the binary tree inversion question on Leetcode https://leetcode.com/problems/invert-binary-tree/ I came up with this solution TreeNode* invertTree(TreeNode* root) { if (root ==...
Raghav Wadhwa's user avatar
0 votes
0 answers
74 views

I am working on a program that is supposed to build a tree using nested lists in Racket. I believe I am very close, but I am stuck on one section of my insertion testing process. The syntax for my ...
JoshLeonthe1st's user avatar
0 votes
1 answer
112 views

I'm writing a program that will update a Rust project's imports to be from their new locations after a breaking change in a library. In this instance, I'd like to flatten all imports from vexide::...
lewisfm's user avatar
6 votes
3 answers
418 views

I've got a list P of 2-dimensional points, 100 ≤ |P| ≤ 100000, and a list C of circle centers, 100 ≤ |C| ≤ 100000. All coordinates (x,y) ∈ P or (x,y) ∈ C are integral, 0 ≤ x,y ≤ 4095. P and C may ...
hidefromkgb's user avatar
  • 6,012
2 votes
1 answer
126 views

I want to create a multi-line string that can be printed out or displayed via curses. This string displays the moves and variations of a go/weiqi/baduk game from an sgf file using unicode characters. ...
Ali Kakakhel's user avatar
0 votes
1 answer
70 views

I'm working on a transcript analyzer personal project and I'm having an issue comparing the courses that are read in from the transcript with the required corses. The required courses are stored in a ...
Ian Millican's user avatar
-2 votes
1 answer
108 views

Using tree package treelib in Python I define a small tree that is slightly modified from the description for command show: from treelib import Tree tree = Tree() tree.create_node("Root", &...
granular_bastard's user avatar
-1 votes
0 answers
56 views

I have the following entity: @Tree('closure-table') @Entity() @Unique(['target', 'slug']) export class SupportNodeEntity extends TreeNodeEntity { @Column({ type: 'enum', enum: SupportNodeVisibility, ...
Korer's user avatar
  • 383
0 votes
4 answers
614 views

You are given an unweighted tree with N nodes and each node starts with value 0. There will be Q queries. The 1st type of query will change the value at a node to a new value. The 2nd type of query ...
Isabella's user avatar
2 votes
1 answer
210 views

I'm trying to solve LeetCode 199. Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. I've ...
Benny's user avatar
  • 519
3 votes
1 answer
176 views

I need a function that parses a string to create a non-regular tree and returns a pointer to its root. In the case of a parsing error, an exception is thrown. My current attempt leaks memory. How to ...
yoan's user avatar
  • 55
1 vote
0 answers
75 views

Description: I'm using the Ant Design Tree component with drag-and-drop enabled. During drag, the tree auto-scrolls based on the mouse position — which is expected. However, it keeps scrolling even ...
Rajath's user avatar
  • 3,018
2 votes
2 answers
163 views

All the pages I have been able to add support for dark/light mode. One page has a tree and everything I tried failed and most changes made the formatting (text, alignment, etc.) change, for the worse. ...
Mark's user avatar
  • 123
0 votes
0 answers
155 views

I'm trying to understand how an AVL tree is built from a sequence of integer keys. The keys I have are: 10, 20, 5, 4, 3, 2, 30, 40 I want to construct the AVL tree step by step and see how rotations ...
shakir Sumon's user avatar
2 votes
1 answer
135 views

Based on this example I have a phylogenetic with species at the tip and branch lengths (that are not necessarily 1). My goal is to calculate phylogenetic diversity multiplying a species community ...
M. Beausoleil's user avatar
0 votes
1 answer
46 views

This is a weird one but I'm a major novice when it comes to React, I'm probably just doing this completely wrong but I'm trying to dynamically render a content tree. It starts with a single node and ...
Erica Stockwell-Alpert's user avatar
-2 votes
1 answer
147 views

We are given an undirected graph ( G = (V, E) ), where: ( V ) is the set of vertices (or nodes), ( E ) is the set of edges. Each edge ( e ∈ E ) has two attributes: A weight ( w(e) ), which is a ...
Ikshvaku's user avatar
  • 103
2 votes
1 answer
234 views

I am struggling with a R script I made to visualize a phylogenetic tree obtained after aligning (mafft), curating (bmge) and tree inference using FastTree and a GTR model. My problem is how the ...
Edouard94's user avatar
1 vote
1 answer
94 views

First time working on a network in R, and I was looking into some possible packages/libraries to do so. There is this guide using ggraph that seems pretty complete and has some nice features I'm ...
Matteo's user avatar
  • 693
1 vote
1 answer
148 views

I'm trying to find all possible bracketing of an associative operation. There's only one possibility for n=2 variables: (a + b) ∘ | +--------+ | | a b For n=3, there are 2 ...
J...S's user avatar
  • 5,269
3 votes
1 answer
873 views

I'm having trouble implementing a threaded Binary Search Tree in C++. I have a non-threaded tree completely implemented (see below code). What I'm having difficulty with is setting the threads to ...
Boom's user avatar
  • 520
0 votes
0 answers
33 views

I have been working on a DOM object in Rust and to insure document integrity I want to implement back references to parent objects, prevent circular references, etc. Minimally my code looks like this: ...
Andrew's user avatar
  • 319
1 vote
1 answer
62 views

I want to fit a lmtree where the response is multivariable. You know that you can fit a Multivariate Multiple Regression using lm function as follows: lm(cbind(Y1, Y2) ~ X1+X2+X3, data = my_df) so I ...
Nicolas Molano's user avatar
2 votes
2 answers
183 views

I'm currently creating a custom Odoo13 module where I want to display a wizard to the user with a table of values, so they can select one or many rows and after clicking a button, perform an action ...
Alberto M's user avatar
1 vote
1 answer
96 views

I manually define the following 16 matrices in Python : matrices = { "Simulation 1": [ [1, 1, 1, 1, 1, 2], [1, 1, 1, 1, 2, 2], [1, 1, 1, 2, 2, 2], [1, 1, ...
stats_noob's user avatar
  • 6,985
0 votes
0 answers
45 views

I have data modeled as a tree, where the data in each node is a name field. No two sibling nodes may have the same name. I have copies of the tree representing the state before and after a sequence of ...
Tim Schommer's user avatar
0 votes
0 answers
86 views

I'm trying to analyze the time complexity of the following recurrence relation using the recurrence tree method: T(n) = T(n - sqrt(n)) + n^2 The challenge I'm facing is determining the height of the ...
pouya's user avatar
  • 1
2 votes
2 answers
287 views

In excel I have this table with 2 columns : Table called T_DATA dataset datasource APP1 DTM1 DTM1 Dataset1 DTM1 Dataset2 DTM1 Dim1 DTM1 Dim2 Dataset1 Raw1 Dataset2 Dataset3 Dataset2 Raw5 Dataset3 Raw2 ...
Laurent Bosc's user avatar
2 votes
2 answers
261 views

I have models that were designed trough SAS hpsplit procedure, outputing results to SAS files. The content of the SAS files are quite complex... Despite being only in standard 'if then' format, they ...
Lucas Morin's user avatar
1 vote
1 answer
153 views

In an Order Statistic Tree which is also AVL, if the dimension of the left subtree is 2, what is the maximum dimension of the right subtree? What I think is that we can add 6 nodes in the right ...
SF40's user avatar
  • 91
1 vote
1 answer
108 views

Problem Statement I am trying to solve a variation of the Maximum Path Sum in a Binary Tree problem where some nodes in the tree are colored red. The path sum is only valid if: The path starts and ...
PodGen4's user avatar
  • 390
0 votes
1 answer
78 views

This hierarchy has several top level parent nodes which roll down into children nodes which roll down into varying levels of depth containing deeper level children nodes. The level in which a node ...
Matt's user avatar
  • 3
2 votes
1 answer
235 views

I am trying to visualize the organization chart of our company, but there is a part that I have difficulty with and that is grouping. Since Reactflow sells this feature for a fee, I need to develop it ...
Avora's user avatar
  • 372
2 votes
2 answers
4k views

I am upgrading an Angular app to version 19. After the upgrade, I found out that NestedTreeControl is deprecated. Even though it is still available, my IDE shows that @deprecated Use one of ...
Mahyar Pasarzangene's user avatar
3 votes
1 answer
453 views

I have a graph containing sum nodes, choice nodes and point nodes. I'd like to maximize the number of points at the root of the graph. The value you get for a point node is the number of points on ...
danvk's user avatar
  • 17.3k
0 votes
1 answer
112 views

Problem: Starred Nodes: Nodes with names ending in "*" are considered "starred." Requirement: Any starred node that is not a direct child of another starred node should become a ...
F. Zer's user avatar
  • 1,311
2 votes
2 answers
52 views

In a class for tree-structured data, I'm trying to get the path from a certain node to the root. The get_forward_path() method below works in the first run, but its output list grows forever everytime ...
Hyde Fukui's user avatar
1 vote
2 answers
127 views

I have been deeply studying foldTree function in Haskell, which is defined as follows: foldTree :: (a -> [b] -> b) -> Tree a -> b foldTree f = go where go (Node x ts) = f x (map go ts) ...
F. Zer's user avatar
  • 1,311
1 vote
1 answer
87 views

I am trying to visually print out a simple binary tree in Java. Here is the full code: class WordPoint { private final String word; private final float pointValue; public ...
DBar's user avatar
  • 13
0 votes
1 answer
27 views

Alternative headline: traverse all nodes in a tree between two nodes. I have a DOM tree (an ordered tree, where child elements at each level have a specific order). I am given start and stop nodes in ...
Phrogz's user avatar
  • 305k
0 votes
1 answer
139 views

I was just starting out with dynamic programming and tried solving factorial problem using the same, i used binary tree for underlying data structure, but when i thought of comparing it with normal ...
Vishwas MIshra's user avatar
0 votes
1 answer
90 views

I am working with a weighted tree and need to answer multiple queries efficiently. Each query asks for the number of pairs of vertices (u,v) such that the maximum edge weight on a simple path between ...
אוהד גולדברג's user avatar

1
2 3 4 5
336