tree

Why No Cycles in Eric Lippert's Immutable Binary Tree?

I was just looking at Eric Lippert's simple implementation of an immutable binary tree, and I have a question about it. After showing the implementation, Eric states that Note that another nice feature of immutable data structures is that it is impossible to accidentally (or deliberately!) create a tree which contains a cycl...

Please help me to create parse tree from java and ANTLR

Hi, everybody, Please help me this problem: I do the example on the page: http://www.antlr.org/wiki/pages/viewpage.action?pageId=1760 in order use this example, i have built the grammar P on ANTLRWork 1.4 and generate code to have class PLexer and PParser. But when i run this code on java Jcreator 4.5: import org.antlr.runtime.*; impor...

How to draw a tree structure? (A two-dimensional space allocation tree recursion algorithm?)

I have an arbitrary tree structure of nodes. I want to draw this tree to provide users a visual representation. I need to recurse over the tree and for each node add a graphic item to a list, and then just draw the list of items once tree recursion has finished. The recursion and drawing of items is of course trivial - what's a bit more ...

Visual Tree (graph) generating

I'm trying to find a piece of software or some API / technology that would allow me to do the following.... I'm looking to generate a family tree based on input I was to feed into a piece of software. I'd like each child of the tree to be clickable and for me to embed it into a website somehow. ...

flex tree discloser icon problem

Hi, i gave the tree an ArrayCollection as dataprovider that i pulled from the database, and it contains the children, but the discloser icon wont disappear on an object that doesn't have a child. i think the problem is that the renderer doesn't recognize the leaf child, wich contains a children array of length 0, or null...... ...

Finding all non-empty categories in a tree

I have a categories table set up as so [id, name, parent_id] and a items table [id, name, category_id, visible]. What I'm trying to do is create a query that will return all the ids of all non-empty categories, non empty being that it or one of it's children has at least one item belonging to it. What would be the best way to do this in ...

[ExtJs] How to add checkboxes to Ext.tree.TreePanel?

Hi all, I created this simple tree: var children = [{ text:'My Layers', children:[ new Ext.tree.TreeNode({text:'test1',leaf:true}), new Ext.tree.TreeNode({text:'test2',leaf:true}) ] }]; var tree = new Ext.tree.TreePanel({ loader:new Ext.tree.TreeLoader(), width:150, ...

Where can I find an efficient R-Tree implementation?

I'm looking for an R-Tree implementation, in C, Objective-c and even C++, which shall be efficient for searching the 2d rectangle in which a point falls ( memory efficiency would also be great, but I can sacrifice a bit more memory for time even while I am on an iPhone ). A good documentation will be appreciated too ...

C# Deep Copying Tree Structures with BinaryFormatter

EDIT 1 Kent has alleviated my fears. However, I've found one exception to the rule. I wrote a method for the Node class that would traverse up through the hierarchy until it got to the root Node and return its hash code. The hash code's the same all the way down the line except for one single object. In a word, RAGE. I'm at the end o...

ASTreeView help! (using JavaScript with .dll's)

I love the demos of ASTreeView. I'd like to use this in my project, which is completely local and currently only uses HTML, JavaScript, and CSS - i.e. no ASP.net or anything dealing with servers... Is it possible for me to use this? There is a .dll and a .js included in the package, but I have no clue where to start since this isn't a A...

Is there any widget to display an XML file as an expandable/collapsable tree in GWT?

Is there any GWT or GXT (or other library) widget that displays the contents of an XML file as a tree? Each node of the XML document would be a tree node and the user could expand/collapse the nodes by clicking on them. Syntax highlighting is also desirable, but that's an extra that I'm willing to live without. ...

flex tree node types

hi, i have a tree of nodes that i dont want some type of nodes to appear in the tree, i can check the data on tree item renderer for each specific node type, so i have one type that i dont want it to be shown as tree node, like it doesn't exist. if(this.data.type == TypeEnum.id){ this.visible=false; this.height ...

OCaml Tree Tutorial

Hello, I'm searching for an good OCaml Tree tutorial... ...I need a few examples of how to remove elements, add elements, remove subtrees... Br, Wolfy ...

storing links of a site in a tree

I am trying to store the links that I scrape from a site in a non binary tree. The links are laid out hierarchically (obviously). The question is how do I generate the tree ? I mean, how am I going to work my way through the pages provided by the link so that I know who is who's child. For now I can get the first and the second level of...

How to convert array to tree?

I have two arrays ["a", "b", "c"] ["a", "b", "d"] I want to convert it to { a : { b : { c : null, d : null } } } How can I do that? ...

Datastructure Interview Questions and answers

Hi, please post the possible data structure interview Questions and answers.. it will be helpfull for all who reffers this post. Thanks ...

Install Shield - How to Disable specific feature in feature tree?

I am new to install shield , I have an Install Script msi project and have some features, I want feature3 to be greyed out in sdfeaturestree dialog. Kindly help me in to this I am very stucked. kindly tell me the fucntion which disable the check box of specified feature.? thanks very much ...

select equal sized number groups from a sequence of random numbers

say i have a list of 100 numbers, i want to split them into 5 groups which have the sum within each group closest to the mean of the numbers. the simplest solution is to sort the hundred numbers and take the max number and keep adding the smallest numbers until the sum goes beyond the avg. obviously that is not going to bring the best...

nhibernate fetching entire tree

Hi, I need help fetching tree hierarchy from db using nhibernate 3.0 QueryOver.Of<Enterprise>(() => entAlias) .JoinAlias(() => entAlias.ChildEntities, () => childEntityAllias, JoinType.LeftOuterJoin) .TransformUsing(new DistinctRootEntityResultTransformer()) I am getting only the two level of the graph (parent and its child...

What would be the relational way to store a tournament bracket in MySQL?

Right now I have a table for matches where each match has a reference to 2 competing participants and a winner, but there isn't a way to store the order of the rounds. ...