tree

Jquery File Tree - how to return folder name on folder click

Hi, I have installed and trying to customize Jquery File Tree so that, on click of folder name, the folder name and path are returned to the calling function. Currently it only expands and collapses folders, and returns the file name on click of file. So I need to return the folder too and cannot see where that is triggered. I am usi...

When two trees are equal?

If in-order traversal of two binrary trees (not binary search trees) are the same, does it guarantee that the two trees are the same? if answer is no, then what about both in-order and pre-order traversal are the same? ...

Best way of representing a tree in XML

What is the best way to represent a tree structure with XML? Each element in the XML tree has an attribute that refers to a node, X, in the tree which I speak of. However, the element has to also be duplicated such that the attribute also refers to all roots in the subtree rooted at X. This can become very repetitive when you have many e...

Represent a directory tree family-tree style

How can I output a representation of a directory tree in a family-tree style like this one where one to ten are directories at different levels under the root directory? root | ----------------------------- | | | | one two t...

How to create an AVL Tree from ArrayList of values in O(n) time?

My assignment is to create an AVL Tree from a sorted array list of values in O(n) time where n is the number of values I have been working on this but I cannot get O(n) time, the best I can get is O(nlog(n)) My problem is that every time a node that causes the tree to be unbalanced is inserted, I have to do another loop to find the nod...

flex tree busy cursor

Hi, i am using a tree with an array collection, i have tried to run busy cursor on expandItem but now i dont know were to stop it when the tree finishes loading children, ...

List/tree/Stack - Algorithm

Hey guys, I need to do a project at the college, it needs to use list/tree/stack to perform any task. I was thinking on the Google's algorithm to recognize the phrase while the guy is typing. Does anyone has this algorithm? Or any other better idea that use list/tree/stack? Thanks ...

Anyone have a large folder tree sample?

I'm doing some testing that requires a large folder tree. 1000s of folders, 100000s of files, atleast a gigabyte but not over 5 thats a little big. (around 2 is fine). Anyone have one that they use as a test file? I can provide storage and transfer mechanism to share if you need it. ...

Finding Center of The Tree

I have a question which is part of my program. For a tree T=(V,E) we need to find the node v in the tree that minimize the length of the longest path from v to any other node. so how we find the center of the tree? Is there can be only one center or more? If anyone can give me good algorithm for this so i can get the idea on how i ca...

How can I get the Item Renderer that is at the top of the viewport in a Flex Spark List?

I have a Flex Spark List (well it's a Tree to be precise but it renders as a list) and as I'm scrolling through it I want to provide information about the item that is currently at the top of the list in context to the viewport. So this could be the 100th item in the list depending on how far you've scrolled down. ...

set of all spanning trees

I want to generate the set of spanning trees of an undirected graph such that each edge appears in at least one spanning tree. Can someone suggest me an algorithm for doing this, or if there is a usable code for this, that will be even better. Thanks. ...

Printing tree with SQL CTE

Hi The schema is as follows: CREATE TABLE [Structure]( [StructureId] [uniqueidentifier] NOT NULL, [SequenceNumber] [int] NOT NULL, -- order for siblings, unique per parent [ParentStructureId] [uniqueidentifier] NULL, CONSTRAINT [Structure_PK] PRIMARY KEY CLUSTERED ( [StructureId] ASC ) ) ON [PRIMARY] ALTER TABLE [Str...

tree implementation in buffer of fixed size

Which open source implementations of a tree (with arbitrary number of children per node; nodes containing a small data type like int or a pointer (additional to the implementation-specific indexing data, of course)) in a (linear) buffer do exist? (Obviously, the maximum number of tree nodes is bounded by the buffer size) (Graph instead ...

GWT 2.1 Tree or CellTree?

I'm really struggling with a choice between the GWT Tree widget, which has been a part of GWT for ages; or the new CellTree, which is introduced by GWT 2.1. The tree I want to present to the user is not particularly large, but I am very concerned about responsiveness. The data at the nodes of the tree will be editable. By clicking on a...

problems with a JTree, it doesn´t display

Hi! I´ve done a tree but it doesn´t display...even it doesn´t allow other components to appear... here is part of the code. private JScrollPane treeView; private JTree treeInicio; protected DefaultTreeModel treeModel; DefaultMutableTreeNode top = new DefaultMutableTreeNode("Root"); private Toolkit toolkit = Toolkit.ge...

Height of 2-3-4 tree

I have a working snippet to use for a regular tree comprising nodes. Now I just need to fiddle with it to work for 2-3-4 trees, which should be easier, since each path is the same distance, since it's balanced, right? Methods I have at my disposal include getNextChild(), split(), and of course insert(). public int height() { return...

ExtJS Tree same parentNode

Hi All, I am rendering a Tree using Jason array that i get from a jsp page. So the tree has root node and 3 nodes and each node has more than 5 children and some of the children has same id and same text. It renders properly and no issues in display. I am trying to make the user select child nodes of only one type (one of 3 nodes). if ...

Is there a better way to find lowest common ancestor in a binary search tree?

I know similar questions have been asked before, but I think my solution is far simpler. Especially compared to [http://en.wikipedia.org/wiki/Tarjan's_off-line_least_common_ancestors_algorithm]. Please prove me wrong! If you have a tree with nodes that have the given data structure: struct node { node * left; node * right; ...

Odd error message when instantiating a template class

Hi all, I am getting an error I do not understand. There was even a similar question asked on SO that I found, but the fix given is already in my code. I am getting an error in this line: ForestNode<NODETYPE> foo = new ForestNode<NODETYPE> ForestNode(bar); that reads : \project 4\forest.h|85|error: expected ',' or ';' before 'Fores...

How Database stores data internally in B-Tree/B+Tree

My question is that How database stores data and how it performs query internally. Suppose we have following fields in our table: ID Name Age Weight Manager and we query select * from Table1 where age>50 and weight<100 I am just curious that how it perform query internally. What will the Node of B-Tre/B+Tree contains in this exam...