For questions about the data structures known as trees.

learn more… | top users | synonyms

2
votes
1answer
79 views

Explore a nested list

This question is similar to Numbering nested list according with Depth (or Level) I have a list like ...
1
vote
1answer
109 views

TreeForm display with nested lists as nodes

If i have a nested list representing nodes in a binary tree, {3, {2, {1, None, None}, None}, None}, what is the easiest way to show the hierarchy, without all the ...
4
votes
1answer
279 views

Extracting text from nested HTML lists <ul> <li>

We wish to analyze the tree structure of HTML documents that consist of nested lists, ie, using the HTML tags <ul> and ...
3
votes
1answer
79 views

Some _atomic elements' TreeForm looks confusing with Level in appearance

In[1]:= Level[1/2,{-1}] Out[1]= {1/2} TreeForm[1/2] ...
1
vote
1answer
113 views

Table/Tree of values

My question: Is there a way to create a tree of values? Something like the output of the command TreeForm, but with values in the nodes? Why do I want this? I'm trying to do a complete program to ...
3
votes
1answer
147 views

How to make a simple tree yourself with defined distances for each generation?

I'm trying to make a function that generates a tree for spin spin analysis in spectroscopy. I though it would be pretty easy, but I'm totally stocked. The tree should look something like this: ...
7
votes
3answers
361 views

Visualizing directories

How do I plot the content of a directory and all its subdirectories into infinity using TreeForm? I've tried using a mix of FileNames, StringSplit and GatherBy but in the end I couldn't find even a ...
2
votes
1answer
220 views

Changing some stuff to Kruskal's Algorithm

I'm trying to modify this algorithm: http://demonstrations.wolfram.com/ConnectingTownsUsingKruskalsAlgorithm/ The thing is that I want to receive a Graph (declared outside, with all its vertex, edges ...
19
votes
3answers
2k views

How to generate a random tree?

Is it possible to generate a random tree without explicitly constructing a random adjacency matrix that satisfies tree properties? How about a random directed tree? Edit: incredible answer by ...
12
votes
1answer
319 views

Transform an expression into a graph that can be plotted with TreeGraph (not TreeForm)

I would like to plot an expression (like TreeForm does), but using the new TreeGraph functionality. ...
19
votes
3answers
390 views

How can I regroup elements in a list into a tree based on their values?

I have a list of elements in an outline, here is an example that is only 3 levels deep: ...
36
votes
0answers
1k views

How to construct a treemap using non-rectangles?

I've written the standard version of a tree map (a graphic that shows nested data) and I'm looking to improve on this layout by switching to different types of polygons or perhaps circles. Can anyone ...
13
votes
1answer
405 views

Visiting nodes in a tree bottom up

I have a problem that can be reduced to this one: Suppose I have an unbalanced (almost random) tree. The leaves of the tree have one property already set, and all vertex (including the leaves) have ...
4
votes
2answers
239 views

Access pairs of vectors, rather than the matrices, in partitioned data structure at a levelspec

I have some old code to analyze correlation between 2 time series by looking at windows of different lengths shifting across the time series data. The code: gets 2 sets of time series data (in ...
9
votes
4answers
206 views

Leave expression tree formatting the same when a replacement rule is applied

If I type e1 := 3 x + 2 (1 + y) z // TreeForm, I get an expression tree. If I then type e1 /. x -> 3, I get another ...
6
votes
2answers
213 views

Truncate TreeForm to show only the top

For some expressions, TreeForm may grow very long. I'm only interested in the top levels of the expression. How can I get the tree form of only the first levels an ...