tree

Does the Java API have a data structure to represent hierarchy

I've got two classes; one interprets commands, and sends these commands to another class which executes them. I then want the class which executes the commands to be able to send the results of this execution back to the interpreter class. The problem is that these results are hierarchal in nature. Right now the only thing I know of i...

Building an XML tree from an Array of "strings/that/are/paths" (in Ruby)

What is the best way to build an XML tree in Ruby if you have an Array of string paths? paths = [ "nodeA1", "nodeA1/nodeB1/nodeC1", "nodeA1/nodeB1/nodeC1/nodeD1/nodeE1", "nodeA1/nodeB1/nodeC2", "nodeA1/nodeB2/nodeC2", "nodeA3/nodeB2/nodeC3" ] xml = <nodeA1> <nodeB1> <nodeC1> <nodeD1> <nodeE1/> <...

WPF TreeListView

Hi everyone! I was wondering if anyone knows how to use the TreeListView in WPF/XAML/Expression Blend. Without using the code behind. This what I want to do. I would like to populate a TreeListView with information, if the information's client and matter are the same, then just make that item a child of it. Example: Client 1= Kevin, ...

Is there an event for collapsing a rich:tree node?

I've finally managed to receive events if the user expands a node of my client side handled tree using the following method: public void processExpansion(NodeExpandedEvent event) throws AbortProcessingException { if (event != null && event.getSource() != null && event.getSource() instanceof HtmlTree) { this.expandedNodes.add(((UITree...

extjs: Changing the value of a node

Hello All, I'm sure this is really simple, but i can't seem to find it anywhere! All I am trying to do is change the displayed value of a tree node. I thought that tree.getNodeById(myNode).text='HHHHH'; or tree.getNodeById(myNode).value='HHHHH'; would do the trick, but i get nothing. What am i missing? Thanks Craig ...

Browse the tree of a website visually?

Is there a way to see the tree of a website? Let's say: www.randomsite.com has a folder at root, named "idunno" which contains a file "hello.html". Is there a way to browse these like using explorer? ...

How to implement tail recursion for tree algorithms in prolog.

How could I convert the following into a tail recursive version. sum(void,0). sum(t(V,L,R),S) :- sum(L,S1), sum(R,S2), S is V + S1 + S2. It seems impossible to maintain a single accumulator as the branching is in 2^n magnitude. A possible solution would be to have the accumulator add a new accumulator to a list on each iterati...

How do I insert/delete/update in an ordered tree

I have two tables in which I store a tree with ordered levels like this: Table: TreeData --------------- ID (int) (primary key) Data (string) Level (int) (not null) --------------------------------------------- Table: SubTree --------------- parentID (int) (foreign key #1 to TreeData.ID) childID (int) (foreign key #2to TreeData.ID) o...

LINQ Is it possible to get a method name without a return type via LINQ expression trees?

Hi! I know it is possible to retrieve a property name or a method with a return type. But is it also possible to get a method name without a return type via LINQ expression trees? Example: string methodname = GetMethodname(x=>x.GetUser()); ---> results: "GetUser" ...

TreeModel backed by Lists

I want to build a TreeModel from some Lists that contain the source data. Now, there's an utility class called DynamicUtilTreeNode that can be used to build trees from arrays, Vectors and Hashtables, but... not from Lists?! Of course I could use the List's toArray() method, but it gives a clone array of the List's state at the moment, so...

a xsd general tree structure, to be compiled to object model with xsd.exe

hi, say i want my xml to include any number of CONTAINER tags, which every one of those to include yet again any number of container tags, and so on. how would the xsd look like? p.s. i want this xsd to be compiled to classes. thank you very much. ...

Flex tree expand and collapse

Hi, I have created a tree with a custom treeitemrenderer where I have added a textinput box next to each label. My data provider is an ArrayCollection. When I enter value in the input box, I can see the value fine as I expand or collapse the tree using the disclousure arrow. There is a strange issue when I try to expand and collapse tree...

SSRS 2005 treenode as report parameter

Hi, I have report data that belongs to regions in a tree (with infinite levels). What I would want is to allow the user to choose a region (node in the tree), and pass that parameter on to my stored procedure, which will collect appropriate data. I have created some reports with drill-down matrices, which sort of does what I want. I ne...

ASP.NET Tree Control - Cannot re-expand tree on reload

I have the following code to delete a company displayed in my ASP.NET 2.0 Tree control: protected void Delete_Click(object sender, EventArgs e) { TreeNode parentNode = null; int expandDepth = 1; string companyID = ""; expandDepth = companyTree.SelectedNode.Depth; if(companyTree.SelectedNode.Parent != null) p...

Adding attributes to a dojo tree node on creation

I'm using a dojox.data.QueryReadStore to populate a dijit.Tree dynamically on expansion of each node. When each of the child TreeNodes is created, I'd like to put a custom attribute on it. How do I get called back on the automatic creation of TreeNodes before rendering? ...

pointer problem in implementing Tree in C

I am implementing an avl tree for my assignment. #include <string.h> #include <stdlib.h> #include <stdio.h> #include <assert.h> struct TreeNode { char *item; struct TreeNode *left; struct TreeNode *right; signed char balance; }; typedef struct TreeNode Node; void _print_avl (Node *, int , const char *); Node * get_new_node (...

how to design any tree(simple bst or avl or rb) which supports searching by both key and value???

suppose i have some data of type(key,value).how do i effeciently sort them so that i can find the key uising value and value using key? ...

constructing random "integer" tree - depth-first / breadth-first

Hi, This is my first ever attempt at writing a recursive function in c. The following-code works. I apologize for the long posting, but I am trying to be as clear as possible. I am trying to generate a tree where each node (inode) has an integer field "n". Correspondingly, each inode has an array of pointers to "n" other inodes. Func...

Dojo tree selected node

Upon creating a tree from a store in dojo, it seems to pre-select the top node in my tree; does anyone know how to stop this from happening? ...

tree traverse recursive in level-first order and depth-first order

Hello, Is there any algorithm can traverse a tree recursively in level-first order and non-recursively in postorder.Thanks a lot. ...