tree

How to show unexpandable nodes in Powerbuilder Tree Datawindow

I am using a tree datawindow in powerbuilder. This repesents a mixture of tree and table. My problem is: the tree doesn't visibly distinguish between expandable und non-expandable nodes. If a node is not expandable, the icon in front of the node is still a plus sign, and if I click on the plus sign, the tree shows an empty node below t...

How to create a Binary Tree from a General Tree?

I have to solve the following constructor for a BinaryTree class in java: BinaryTree(GeneralTree<T> aTree) This method should create a BinaryTree (bt) from a General Tree (gt) as follows: Every Vertex from gt will be represented as a leaf in bt. If gt is a leaf, then bt will be a leaf with the same value as gt If gt is not a leaf...

How to find sum of node's value for given depth in binary tree?

I've been scratching my head for several hours for this... problem: Binary Tree (0) depth 0 / \ 10 20 depth 1 / \ / \ 30 40 50 60 depth 2 I am trying to write a function that takes depth as argument and return the sum of values of nodes of the given depth. For instance, if I pass 2, it should return 180 (i.e. ...

Getting tree construction with ANTLR

As asked and answered in http://stackoverflow.com/questions/2999755/removing-left-recursion-in-antlr , I could remove the left recursion E -> E + T|T T -> T * F|F F -> INT | ( E ) After left recursion removal, I get the following one E -> TE' E' -> null | + TE' T -> FT' T' -> null | * FT' Then, how to make the tree construction ...

How can I force a tree itemrenderer to redraw during a drag and drop operation?

I have a tree control with a custom item renderer. The item renderer has different states that should be set while an item is being dragged over the item renderer. I understand from reading this post http://forums.adobe.com/message/2091088 that the 'right way' to do this is to override the 'getCurrentState' method and append some text. I...

Delete on a very deep tree

I am building a suffix trie (unfortunately, no time to properly implement a suffix tree) for a 10 character set. The strings I wish to parse are going to be rather long (up to 1M characters). The tree is constructed without any problems, however, I run into some when I try to free the memory after being done with it. In particularly, if...

how to print trees onto console?

it would be nice if i could print the binary search trees i am writing onto python console ? any idea how to do it? ...

Recursive Function To Create Array

Hi, i use kohana framework and i am trying to code recursive function to create category tree. My Categories Table id int(11) NO PRI NULL auto_increment name varchar(50) NO NULL parent_id int(11) NO NULL projects_count int(11) NO NULL My Example Which Is Not Work publi...

dijit Tree : finding treenode associated with new data store item

I want to highlight a programmatically inserted node. I'm inserting using store.newItem; this gives me a datastore item. To do the highlighting, I need a treenode. Can someone tell me how to find the treenode associated with the item? Thanks, Larry ...

What's the simplest and fastest way to draw a parse tree using .Net?

I've written a simple top down parser using c#. It's a console application. I'd like the parser could save, at the end of the computation, an image file of the parse tree. I think I could use graphviz, but I'd like to know your opinion. Thanks. ...

In Python ElementTree how can I get list of all ancestors of an element in tree ?

I need "get_ancestors_recursively" function. A sample run can be >>> dump(tr) <anc1> <anc2> <element> </element> </anc2> </anc1> >>> input_element = tr.getiterator("element")[0] >>> get_ancestors_recursively(input_element) ['anc1', 'anc2'] Can somebody help me with this ? ...

With ' N ' no of nodes, how many different Binary and Binary Search Trees possible ?

For Binary tree: You no need to consider tree node values, I am interested about different tree topologies with 'N' nodes. For Binary Search Tree: We obviously consider tree node values. ...

In GWT-EXT checkboxtree how to handle single selection of tree nodes?

hi, I'm working on checkBoxTree in GWT-EXT 2.0.3 with Java. My aim is to get a selectionModel which allows me to select(check) only one TreeNode at a time. If I select another TreeNode after selecting one then, the previous one should be unchecked. I've tried using DefaultSelectionModel with TreePanel, but either I've not used it proper...

Three State Treeview Windows Forms

Hello everybody people, One of the frustrations with the standard TreeView is that you can't show a partial selection to indicate that some of the children are selected. A partial selection in a complex tree allows the user to easily determine where the selections are, even if the tree is not completely expanded. A similar idea is use...

mx:Tree not dispatching "itemClick" event when click on icon

I have a flex tree that worked perfectly fine when we set the defaultLeafIcon={null} and the folderClosedIcon and folderOpenIcon to {null}. We decided to put the icons back in and took out the nulls. Now they show up fine, but if you click on the icon instead of the label or the rest of the row, it seems to change the selected item, show...

Updating cached counts in MySQL

In order to fix a bug, I have to iterate over all the rows in a table, updating a cached count of children to what its real value should be. The structure of the things in the table form a tree. In rails, the following does what I want: Thing.all.each do |th| Thing.connection.update( " UPDATE #{Thing.quoted_table_name} ...

Editable List for AS3

I'm looking for an editable list that allows users (not programmers!) to rename items by double clicking and typing within a textbox that should appear. Here's what I tried out: Flash CS3 List - no renaming Flex List - cannot rebuild my entire application within a Flex App. Too much trouble. Yahoo Astra Tree - no renaming! Do you kn...

what is an appropriate tree class in java that use to solve 8 puzzle.

I'm doing an AI for 8 puzzle that develop on java. I have 1 class that keep the 2 dimension array of string that is a 8 puzzle board. This class also keep other necessary information. The question what is an appropriate tree that i will use to keep each object. ...

Looking for a decent implementation of a jquery drag-and-drop tree plugin

I've built a recursive menu using PHP and MySQL and I'm looking for a decent Jquery plugin (or tutorial) - to implement re-ordering the menu based on drag and drop. Does anyone know of any? BTW. I can do the relevant PHP, I just need something that can send drag and drop <li> elements in a nested set of <ul>s and send ajax requests. P....

Letting User add Nodes to a JTree, nodes do not appear if parent has EVER been expanded

I have a problem with inserting nodes in a JTree. Basically the user right clicks on a parent node, bringing up a list of the possible children to insert. They select one it is inserted as a child of the selected node. This all works great when the parent node has never been expanded. However, if the parent node of the node the user ...