tree

drawing hierarchical tree with orthogonal lines ( HV-Drawing – Binary Tree)

Hi I need to work on drawing a hierarchical tree structure (HV-Drawing – Binary Tree) with orthogonal lines(straight rectangular connecting lines) between root and children ( like the following: http://lab.kapit.fr/display/visualizationlayouts/Hierarchical+Tree+layout ). I want to know if there are any open source examples of the algorit...

MethodTree java 6 Compiler Tree API

Given a method name and the Class name where the method is defined, is it possible to construct the MethodTree without creating the ClassTree, The reason why I want to do in this way is , I am doing a static analysis on the java source code,whenever I encounter a method invocation I need to visit that method wherever it is defined and pr...

How do I set if a node is a branch or a leaf?

I have a tree being populated by an array collection. I don't have control of the data in the array collection and even when a node has no children it still has a "children" property that is causing my tree to treat every node as branch. I can do a simple check on the length of the array in the children property. If this is 0 I need the ...

Generic unit test scheduling

Hello, I'm (re)writing a program that does generic unit test scheduling. The current program is a mono-threaded Perl program, but I'm willing to modularize it and parallelize the tests. I'm also considering rewriting it in Python. Here is what I need to do: I have a list of tests, with the following attributes: uri: a URI to test (c...

wxPython TreeCtrl without showing root while still showing arrows

I am making a python tree visualizer using wxPython. It would be used like so: show_tree([ 'A node with no children', ('A node with children', 'A child node', ('A child node with children', 'Another child')) ]) It worked fine but it shows a root with a value of "Tree". I made it so that it would create multiple roots but then learned ...

Algorithms to find longest common prefix in a sliding window.

Hi, I have written a Lempel Ziv compressor and decompressor. I am seeking to improve the time to search the dictionary for a phrase. I have considered K-M-P and Boyer-Moore, but I think an algorithm that adapts to changes in the dictionary would be faster. I've been reading that binary search trees (AVL or with splays) improve the per...

Deeply nested subqueries for traversing trees in MySQL

I have a table in my database where I store a tree structure using the hybrid Nested Set (MPTT) model (the one which has lft and rght values) and the Adjacency List model (storing parent_id on each node). my_table (id, parent_id, lft, rght, alias) This question doesn't relate to any of the MPTT aspects of the tree but I thought I'd le...

How to detect if a certain range resides (partly) within an other range?

Lets say I've got two squares and I know their positions, a red and blue square: redTopX; redTopY; redBotX; redBotY; blueTopX; blueTopY; blueBotX; blueBotY; Now, I want to check if square blue resides (partly) within (or around) square red. This can happen in a lot of situations, as you can see in this image I created to illustrate my...

Javascript / Jquery Tree Travesal question

Suppose I have the following <ul> <li>Item 1</li> <li>Item 2 <ul> <li>Sub Item</li> </ul> </li> <li>Item 3</li> </ul> This list is auto-generated by some other code (so adding exclusive id's/class' is out of the question. Suppose I have some jquery code that states that if I mouseover an li, it gets a background color. How...

trying to build a web ui tree from scratch

I have seen yahoo ui using div for every node of the tree. Is this a good thing to do. Seems like every node including leaf node is heavily nested. I saw a div, table, tr, td being used for creating a node. Is this necessary. Is there a better way to do the same. I tried to us tr for every node. Are there any issues with this approach ...

New to AVL tree implementation.

I am writing a sliding window compression algorithm (LZ77) that searches for phrases in a "moving" dictionary. So far I have written a BST where each node is stored in an array and it's index in the array is also the value of the starting position in the window itself. I am now looking at transforming the BST to an AVL tree. I am a lit...

Balanced Quad Tree

Hi, how can I build a balanced quad tree. Thanks, Marcos ...

GWT Tree, opening event.

I'm using the tree control in GWT. I have a custom widget that I add as a TreeItem: Tree testTree = new Tree(); testTree.addItem(myWidget); I would like to retrieve myWidget instance on the node opening event. Is it possible ? Does anybody knows which event should I be using ? I tried the openHandler<TreeItem> but what I retrieve is...

Behavior Tree Implementations

I am looking for behavior tree implementations in any language, I would like to learn more about how they are implemented and used so can roll my own but I could only find one Owyl, unfortunately, it does not contain examples of how it is used. Any one know any other open source ones that I can browse through the code see some examples ...

Installing sfJqueryTreeDoctrineManagerPlugin to Symfony 1.4

I have faced serious difficulties while installing sfJqueryTreeDoctrineManagerPlugin to Symfony 1.4 w/ Doctrine ORM. The installation directly from the server did not work out like with previous plugins that I have installed: C:\path>symfony plugin:install sfJqueryTreeDoctrineManagerPlugin plugin installing plugin "sfJqueryTreeD...

Recursive breadth-first travel function in Java or C++?

Here is a java code for breadth-first travel: void breadthFirstNonRecursive(){ Queue<Node> queue = new java.util.LinkedList<Node>(); queue.offer(root); while(!queue.isEmpty()){ Node node = queue.poll(); visit(node); if (node.left != null) queue.offer(node.left); if (node.right != n...

Use XSL to transform an XML list into an XHTML tree

I need to take this xml… <root> <item id=’1’ parent_id=’0’>ONE</item> <item id=’2’ parent_id=’1’>TWO</item> <item id=’3’ parent_id=’1’>THREE</item> <item id=’4’ parent_id=’2’>FOUR</item> <item id=’5’ parent_id=’0’>FIVE</item> </root> And produce this xhtml… <div class=’parent’>ONE</div> <div class=’child’> <div clas...

What is this Hash-like/Tree-like Construct Called?

I want to create a "Config" class that acts somewhere between a hash and a tree. It's just for storing global values, which can have a context. Here's how I use it: Config.get("root.parent.child_b") #=> "value" Here's what the class might look like: class Construct def get(path) # split path by "." # search tree for node...

Can a binary tree or tree be always represented in a Database as 1 table and self-referencing?

I didn't feel this rule before, but it seems that a binary tree or any tree (each node can have many children but children cannot point back to any parent), then this data structure can be represented as 1 table in a database, with each row having an ID for itself and a parentID that points back to the parent node. That is in fact the...

.jstree() or .tree(), and how to get it to work

Silly question. A lot of examples using jstree that I find on the web use the syntax $('#someTreeId').tree(), whereas the demo on the jstree website keeps referring to the syntax $('#someTreeId').jstree(). When I use .jstree() I get a browser error saying this is not a function. But when I use .tree I barely get any farther: it only ge...