Quantcast
Channel: Question and Answer » trees
Browsing all 36 articles
Browse latest View live

How to find the number of ordered trees with n edges where in the first...

How to find the number of ordered trees with n edges where in the first subtree root has k edges and k $le$ n – 1.

View Article


component-based power system for a game [closed]

My issue is that I’ve been trying to implement a power/electrical system for a while now. I’m using Unreal Engine 4 with C++ but that’s not really relevant. I’m trying to implement some sort of system...

View Article


Difference between sibling lists, left-child right-sibling binary tree and...

The Wikipedia page for suffix trees descibes sibling lists as Each node has a pointer to its first child, and to the next node in the child list it is a part of. Wikipedia describes left-child...

View Article

Image may be NSFW.
Clik here to view.

Decision tree (?) reduction

I need to check certain conditions (of size n) on an object and perform one of several options available (size m) based on the result. Seems to me it fits a tree. Now. The tree is quite large and I...

View Article

Image may be NSFW.
Clik here to view.

tree and blocks

stackexchange members, I tried to do this but unfortunately I couldn’t. It is really simple. I found some codes and tried to get similar picture as mine. and second image is Thank you so for your help...

View Article


Clean Abstract Syntax Tree

I’m writing a toy compiler for fun. Basically, my problem is that I don’t want to clutter the AST with stuff like debug information (symbol tokens, locations of tokens, etc) as well as data that the...

View Article

Image may be NSFW.
Clik here to view.

Recursion Tree in LaTeX

How can the following recursion tree be drawn in LaTeX? I have tried using TikZ pictures for this, but I continue to get errors in the code. Please suggest an easier code for the same.

View Article

Image may be NSFW.
Clik here to view.

Garden tree seems “sick”

I have multiple of these trees and one of them seems “sick” – it barely has any leaves and there is some discoloration on it. Is there anything I can do to treat it or do I basically have to rip it out...

View Article


Expandable alternative to Visitor pattern for tree traversal?

I have a tree containing various subtypes of the my base node class. I now want to traverse this tree and do something with the nodes depending on their type. The most straightforward idea is to just...

View Article


Image may be NSFW.
Clik here to view.

What method should I use to populate a tree as I'm consuming data that is...

I have a tree that consists of 5 types of nodes – V, W, X, Y, and Z. V represents the root node, and a given tree has exactly one element of type V. A V contains one or more Ws, a W contains one or...

View Article

Prove that minimum spanning tree is a tree

From the the Wikipedia page Minimum spanning tree: A minimum spanning tree is a spanning tree of a connected, undirected graph. It connects all the vertices together with the minimal total weighting...

View Article

Image may be NSFW.
Clik here to view.

Tikzpicture inside forest node label

I would like to embed a tikzpicture in a forest node label: documentclass[ ,crop=true ,varwidth=maxdimen ]{standalone} usepackage{forest} begin{document} Forest{ [Atikz{node[circle,draw,inner...

View Article

Big-O for Immutable Trees

How would you calculate the time and space complexity for a tree algorithm that creates a copy of a tree, but reuses as much of the original tree as possible? For example, A /| B C G /| D E F To change...

View Article


prooving graph with no cycles and |V | = |E| + 1 is a tree.

My assignment is to prove that G = (V, E) is a tree if and only if |V | = |E| + 1 and G has no cycles. However, I am having some trouble doing just that. We defined a tree as a graph which is connected...

View Article

Image may be NSFW.
Clik here to view.

Copying non-epsilon terminal nodes in parse trees using forest

I’m drawing parse trees for formal grammar using the forest package and would like to have all terminals, that are not Epsilon, to be copied to the bottom and connected to the original node with a...

View Article


Image may be NSFW.
Clik here to view.

Drawing trees with xymatrix

I would like to draw trees using xymatrix, however using for example xymatrix{ar@{-}[dr] & & ar@{-}[dl]\ & ar@{-}[d] & \ & & } returns the image My problem with this is the fact...

View Article

Best way to traverse data and update nodes in Mongo DB

I am using Angular Tree View in my web app. Data coming from the server is build with https://www.npmjs.com/package/mongoose-materialized getArrayTree() function. What I need is, syncing the Angular...

View Article


Image may be NSFW.
Clik here to view.

How to draw trees

I’d like to know how to draw these trees: I really have no idea. I’ve taken a look but I didn’t find out anything that could help me (to draw these trees in particular). So I hope you can help me....

View Article

What is the amount of non-isomorphic trees of order n with a maximum...

It’s a graph-theory model of the theoretical amount of possible non-cyclic alkanes isomers. I can’t find a way to compute it? Any hints appreciated.

View Article

Bus bunching simulation code [closed]

I’m having a peculiar issue to solve. What I am supposed to implement is a bus transit simulation in which there are passengers coming at some random generated time intervals and are added into a queue...

View Article
Browsing all 36 articles
Browse latest View live