tree

Modify XML structure to create a Nested Tree XML structure using XSD or XSLT

Hello, please I was wondering if someone can please help as its quite urgent. I need to convert the structue of an xml file to another xml structure so that I can bind it to a asp.net treeview control (i'm a c# developer). I noticed the asp.net treeview control accepts a transform file or xpath expression and am wondering if some one kno...

Can Two CVS Trees (independent CVS Trees) be merged? How?

We had a CVS tree cvsrootv6 which uses Java 1.4 and Websphere 6.0. Now because we are upgrading our systems we copied the whole CVS tree i.e cvsrootv6 and make a new independent tree cvsrootv7 for Java1.6 and Websphere 7.0. While having cvsrootv6 tree in production we started resolving some versioning issues with cvsrootv7. At the same...

Algorithm for fast point lookup and line of sight traversal

I'm putting together a small library that consumes Geographic Information System (GIS) data and allows for fast point in feature, point near feature, and line of sight queries. Much of this data will consist of big areal features with enormous numbers of vertices. An R Tree variant might work, though I wonder how those perform on the p...

n-Tree traversal from root node down to all childen

Hello I have a List with some tables from a database where each row contains a parent field refering to another row. Like this title, parent A, null B, A C, A D, C E, B F, null Here the A and F are root nodes, B and C is child to A, D is child to C and E is child to B in turn. What is the best way to produce a tree s...

balancing a spanning tree of a growing undirected graph

I am looking for ways to maintain a relatively balanced spanning tree of a graph, as I add new nodes/edges to the graph. I have an undirected graph that starts as a single node, the "root". At each step, I add to the graph either a "cross edge" or a "parent-child edge". Cross edges introduce no new nodes; they just connect two existin...

Understanding Fusion Trees?

I stumbled across the Wikipedia page for them: http://en.wikipedia.org/wiki/Fusion_tree And I read the class notes pdfs linked at the bottom, but it gets hand-wavy about the data structure itself and goes into a lot of detail about the sketch(x) function. I think part of my confusion is that the papers are trying to be very general, a...

Determine the Internal Path Length of a Tree (C++)

Well I'm down to the last function of my program and I'm done. I've hit another stump that I can't seem to fix on my own. int Tree::InternalPathLength(Node * r, int value) { if(r->left == NULL && r->right == NULL) { return 0; } return value + InternalPathLength(r->left, value+1) + InternalPathLength(r->r...

Flex tree space default event listener

I have noticed that when I select tree node if space is clicked the selected node gets opened... how could I remove this event? ...

Google Chrome display JSON AJAX response as tree and not as a plain text

I cannot find an answer to this one: My AJAX calls return JSON data. In Google Chrome Developer Tools > Resources > XHR when I click on the resource on the left and then on the Content tab I see the JSON string as a string and not as a tree as Firebug and Firebug Lite do. How do I force Chrome to diplay it as a tree. Is there a Content...

Flex tree populating with xml over http

Hello, i have a HTTPService providing XML on request. <mx:HTTPService id="selektProdukt_data" url="{l_url_selektProduktservice}" useProxy="false" resultFormat="e4x"/> so invokink the service with: selektProdukt_data.send(); delivers resulting XML <?xml version="1.0" encoding="UTF-8"?> <result> <error_text>OK</error_text> <node...

Java library or code to parse Newick format?

Anyone knows a good Java library I can use to parse a Newick file easily? Or if you have some tested source code I could use? I want to read the newick file: http://en.wikipedia.org/wiki/Newick_format in java and generate a visual representation of the same. I have seen some java programs that do that but not easy to find how the pars...

Finding the no of leaf nodes

An N-ary tree has N sub-nodes for each node. If the tree has M non-leaf nodes, How to find the no of leaf nodes? ...

Removing and adding nodes to a tree

I have an assignment, and I can't figure out what to do about it. I have a tree of people with their name, birth and death year. Think genealogy here. I have a bunch of datatypes to take care of ages, names, the tree itself, etc. and then I have a bunch of people and a tree. The datatypes are: datatype year = Year of int | UnkYear |...

hw to traverse tree in mysql??

node (id , name ,parentid); tree (id, parent id) this is my table structure i want 2 store in this procedure i want to insert nodes id with its all parents eg this is node table contents +----+------+----------+ | id | pid | nodename | +----+------+----------+ | 1 | NULL | 1 | | 2 | 1 | 2 | | 3 | 1 | ...

Adding a node to a tree in SML

I was advised to ask this as a separate question, so that I will do. I have a tree of people, like in genealogy. It starts with a person and branches off into parents, grandparents, etc. I want to be able to insert a person into a spot on the tree (basically replacing whoever is there). These datatypes are important: datatype year ...

Applications of red-black trees

What are the applications of red-black trees? Is there any application where only RB Trees can be used and no other data structures? ...

Java Tree Iterator Help

I am trying to write a class that implements a tree using an array and I need some help to write an Iterator method that which returns an iterator of the elements stored in the tree. Here is my code. import java.util.Arrays; import java.util.Iterator; import java.util.List; public class ArrayTree<E> implements Tree<E>{ protected ...

How do I format a tree so that it works with Clojure's zipper?

I am creating trees of s-expressions for a genetic programming problem, and need to alter parts of the trees during the evolution process. I came across the Clojure zipper function that seems like it should be perfect, but for the life of me I can't figure out how to use it. For example, say I create a zipper with (def zipped (zip/seq-...

Perfect matching in a tree

I came across a definition of Perfect matching: a set of edges that touches each node exactly once. However, i didnt really understand the definition. Can somebody give me an example of any such edge. Or may be point me towards some reference that does. I tried to google but it didnt give me any example. ...

Blitting in the right order - a visitor problem

I'm designing a simple GUI. I have Widgets, which have children and one parent. Each Widget is a Composite object, with a vector of WidgetComposite objects. One of those WidgetComposites is a PaintingBehaviour, but the Widget doesn't know it as such. To display my window, I use a Visitor, called the ScreenVisitor. When the Visitor is c...