tree

Converting string based structure to auto increment based tree structure

I have a tree in my database described using id and parend id. Because of historical( original programmer) reasons the id is strings. I need to convert the id to auto increment integer field and keep the structure the same. How do I do that? I'm using mysql. ...

Java tree data-structure?

Is there a good available (standard Java) data structure to represent a tree in Java? Specifically I need to represent the following: The tree at any node can have an arbitrary number of children Each node (after the root) is just a String (who's children are also strings) I need to be able to get all the children (some sort of list /...

How to implement dijit.trees that expand/collapse when a master does?

I have multiple -- for this discussion, assume two -- dijit.trees, all guaranteed to have identical topology. The first tree is the master; all the others are slaves. I want to: 1) Hide the expando +/- thiny on all the slaves, so that only the master has expand/collapse controls. 2) Make the behavior of the slaves trees mimic t...

Exception free tree destruction in C++

I have recently managed to get a stack overflow when destroying a tree by deleting its root 'Node', while the Node destructor is similar to this: Node::~Node(){ for(int i=0;i<m_childCount;i++) delete m_child[i]; } A solution that come up into my mind was to use own stack. So deleting the tree this way: std::stack< Node* >...

How to create tree using web service?

Hi, I want to create tree structure using web service. I have used bottom up web service technique for creation of simple arithmatic operation. I can not understand, how to build a tree using web services. Is there is way to achieve this? ...

Convert Binary Tree -> BST (maintaining original tree shape)

I have a binary tree of some shape. I want to Convert it to BST search tree of same shape. Is it possible? I tried methods like - Do In-order traversal of Binary Tree & put contents into an array. Then map this into a BST keeping in mind the condition (left val <= root <= right val). This works for some cases but faile for others. ...

How to override child node controls in a Flex Tree control

Hello, I am currently developing a dynamic LineChart in FLEX 4. I am implementing a Tree control next to my LineChart, which will filter the LineChart dataprovider and lineseries. The tree control has several branches and ultimately 5 children (leaf nodes) at the bottom of the last branch. I need the leaf node/children to be displayed ...

What is the cleanest way to extend this design for tree-rewriting?

I have a tree of objects, where each object has a std::vector of pointers to its children. The class of the object has a rewrite() method that is recursively applied to alter the object and its children, typically with the following transformations, where [N] is the object being rewritten and (M) is the element that rewrite() returns: ...

What are the practical applications of the lowest common ancestor algorithms?

I was having a look at this question and then reading about Tarjan's least common ancestors algorithm. I never came across any applications of LCA algorithms before. Where are such LCA algorithms commonly used? ...

How can I scroll a XUL tree element by less than a whole row?

I've got a XUL tree element, and would like to scroll the rows up and down on a per-pixel basis, instead of by whole rows, if possible. Browsing through the source to mozilla-central, and Thunderbird's copy at comm-central, it looks like I can only scroll by rows, but I guess I'm hoping that I missed something. (The other option I saw ...

WPF/Silverlight Tree - How do I make all nodes from a tree to be aligned?

Hi guys, What do I have to do with a Tree in WPF/Silverlight, to have all nodes aligned ar the same level? I mean I need the root and all childs to be align at the same distance from the left side of the screen. Is that possible? Actually I am using a Telerik Silverlight RadTreeView. Any help is welcomed, Thanks ...

Hiding expand/collapse +/- buttons

Is it possible to hide the +/- buttons for an ICEFaces tree node that is a leaf? They still appear on my leaf nodes even when I mark that node specifically as a leaf and say node.setAllowsChildren(false). ...

3-state "expanded", "collapsed" and "semi-expanded" tree control

What I'm trying to do is have a 3 state tree expansion. I have three different icons for "expand" "collapse" "semi-expanded" which I want to use to show a partially populated tree control with all nodes initialized to semi-expanded state and then on clicking the "semi-expanded" icon it gets data from server and populates the tree and op...

Ruby on Rails Paths checking

Hello, sorry for my english, I have worked in a helper to create an objects tree based in :has_many associations and it's working fine, but I have a problem with links: some objects don't have an edit action to create a link (edit_object_path object_id). How can I to know, if an object has edit action? Regards. ...

Seek a Java advanced tree component (include Windowless Richedit Control function)

Hello, I love BooguNote very much (it's a Sharp tool for collecting and organizing information scraps) But what a pity it just run under windows currently. I tried to build a Java version for BooguNote so I can run it under linux (first step: I want to just make a simple BooguViewer ) since I'm not very familiar with so huge Java libr...

Error when the scroller of the mx:Tree with custom renderers is scrolled

I have created a custom multiline item renderer for mx:Tree component. Important to mention that my item renderer has two UITextFields in it. Sometimes (depends of the input data) only one of UITextFields must be shown, so when second UITextField is not needed I hide it and recalculate the height of my item renderer. According to my test...

SQL to retrieve tree structure nicely

Given the simple data structure: ID | Category_Name | Parent_ID Example: 1 Cars 0 2 Boxes 0 3 Lamborghinis 1 4 VW Camper Vans 1 5 Big Boxes 2 6 Small Boxes 2 7 Cereal Boxes ...

ASP.net convert SqlDataReader to tree

Given the simple data structure: ID | Category_Name | Parent_ID Example: 1 Cars 0 2 Boxes 0 3 Lamborghinis 1 4 Camper Vans 1 5 Big Boxes 2 6 Small Boxes 2 7 Cereal Boxes ...

dijit.Tree from XML

Hi All, I've been trying to get a Tree to work using my xml. But i'm like stuck without any clue as how to move ahead. I've tried quite a few things, which i've tried and would mention here. Background: I've been trying to create a tree from XML which looks like: <root> <hierlabel>A_Level0</hierlabel> <hierlabel>A_Level1</hi...

What kind of tree is used in Java's TreeSet and TreeMap?

Are they AVL trees, red-black trees, or something else? ...