tree

Flex Tree not re-expanding

I have a tree control and after I drop an item in it (which updates the dataprovider) I want it to stay open. I've tried a lot of things including the example at this question which I couldn't get to work so I'm doing something I feel is even more basic. Like this: [Bindable] public var open:Object = new Object(); private function drop...

SQL select inverted tree

Hello i have tree structure in sql. Logics is standard: SomeID, ParentID, other fields. I have select procedure, which selects data like this: 1. 1.1 1.1.1 and so on. How to write the select procedure, to get the inverted result(first are selected the deepest branches, last - root branches), like this: 1.1.1. 1.1. 1. 2.2.2.2.2. 2.2....

Minimax use already evaluated tree. Where is my flaw?

Hi, I just started trying to use the minimax/negamax algorithm and I came up with an idea that sounds good for me, but as nobody is using it it might be a flawed logic. Why don't we do this: Create a three with depth=x, figure out which move to make, and wait for our opponent. After he did his move we can just take the subtree of the m...

Yield the shortest path in state transistions

I am trying to come up with an algorithm for a tree traversal, but I am getting stuck. This is a fairly hard question (compared to others I have asked) so I may need to keep figuring on my own. But I thought I would throw it out here. I have the following class structure: public class Transition { // The state we are moving from....

IE6-7 table inside li leave a gap

Hi a am trying to create a tree using CSS. In FF works fine , IE6-7 fails. I have a ul/li structure and inside li i create a table to display the tree row. On IE i have a gap between li and table. Here is the code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional....

Whats wrong? Trying to build a tree.

Calling the function MakeTree(4, gameboard) does not work properly, it only prints out the first validMove-Nodes. What am I doing wrong? private Move MakeTree(int depth, Board b) { Move Tree = GenerateValidMoves(b, b.MyLocation); if (depth == 0) return Tree; foreach (TreeNode<Move> Child in Tree.Children) ...

set map implementation in C++

Hi I find that both set and map are implemented as a tree. set is a binary search tree, map is a self-balancing binary search tree, such as red-black tree? I am confused about the difference about the implementation. The difference I can image are as follow 1) element in set has only one value(key), element in map has two values. 2) se...

Implementing a tree view in seam / JSF using Richfaces or jsTree

I am using seam with EJB3 + JSF and I would like to add a tree view component to the UI. The tree view must allow sorting of the nodes (preferably drag and drop) and must allow selection of leaf nodes. The options I have looked at are: RichFaces Tree jsTree Is there a major benefit to one option over the other? If I use jsTree, wh...

check child nodes of a tree when a parent is clicked [ExtJS]

Hi, I would like to know how can i check the sibling nodes of a tree while clicking on a particular node in ExtJs. I had given id's for each node and i can access the id of a clicked node. then how can i proceed to checking the child nodes automatically ?? somebody please help me.. ...

How to make GIF rotate when the tree is loading in Javascript

I have a tree that gets populated through the web service - this part is super fast, the part that's a bit slower is populating the tree...I have a gif rotating image that rotates while the service is loading. Since I use ajaxStop and ajaxStart trigger, the gif stops rotating after ajax request has completed, which is correct. However, b...

.net dictionary vs other managed custom data structures, why is the .net dictionary so fast?

I am in the middle of developing a custom persistent Key Value type data structure, to compare against SqlLite and Berkley DB. Anyway before I wrote the implementation I wanted to find the best data structure to use for this purposes. I looked at the a couple: An open source redblack tree. Mono Dictionary implementation. I wanted th...

Algorithm to computer the optimal layout of n-ary tree?

I am looking for an algorithm that will automatically arrange all the nodes in an n-tree so that no nodes overlap, and not too much space is wasted. The user will be able to add nodes at runtime and the tree must auto arrange itself. Also note it is possible that the tree's could get fairly large ( a few thousand nodes ). The algorithm ...

Algorithm for building tree hierarchy based on URL paths

This is related to http://stackoverflow.com/questions/711793/parse-url-strings-into-tree-hierarchy But i'm implementing in javascript, therefore require some algorithm here instead of using SQL functions. ...

Javascript building tree hierarchy

var array = [{"grandpa","father"}, {"father"}, {"grandpa","father","me"}]; Given the above array, I want to product a java-script object(JSON) like below, that has the parent-child like structure. {"id":"grandpa", "children":[ {"id":"father", "children":[ {"id":"me", "children":[] }] }] } ...

jquery file tree browser and django

hello, anybody knows a tutorial on using jquery file tree browser on django. i followed this tutorial http://abeautifulsite.net/2008/03/jquery-file-tree/ but i cant make it work, im confused with this code block: $(document).ready( function() { $('#explorer').fileTree({ root: '/windows/', script...

Rank Tree in C++

We need ADT having search and rank features. That is, in addition to the interface of STL map, a function 'int get_rank(key)' is required. Standard implementation of such function requires supporting and updating an extra integer field in every node of self-balanced searching tree (e.g., in black-red tree, used in STL map/set). But it s...

Creating a JSON Tree from a string hierarchy

Given these 4 variables, var el1 = {name:'ronaldo', team: 'europe/spain/realmadrid'} var el2 = {name:'messi', team: 'europe/spain/barcelona'} var el3 = {name:'gerald', team: 'europe/england/liverpool'} var el4 = {name:'unknown english', team: 'europe/england'} I need to produce this JSON tree hierarchy, { "text":"europe", "le...

Java: Cut item from JTree with lazy-deleting

I've implemented Drag'n'Drop and CCP on my JTree (I've created my Transferable and TransferHandler classes). By default Cut action (CTRL-X or SHIFT+DELETE keys) delete item from JTree (JTreeModel), but I want just to mark it with gray color and delete it only after Paste action. How could I make Cut action to avoid deleting items? I d...

Python's standard library - is there a module for balanced binary tree?

Is there a module for AVL or Red-Black or some other type of a balanced binary tree in the standard library of Python? I have tried to find one, but unsuccessfully (I'm relatively new to Python). ...

Find the maximum depth of a tree

I have a tree data structure with N first-level child nodes that have childs too. For example: Root Node1 Node11 Node111 Node1111 Node12 Node2 Node21 Node211 I would like to know which of the braches has the...