tree

Build a tree like representation of data in Excel?

I have a bunch of raw data in this fashion: Parent | Data --------------- Root | AAA AAA | BBB AAA | CCC AAA | DDD BBB | EEE BBB | FFF CCC | GGG DDD | HHH Which needs to be converted into a tree like fashion. This basically needs to end up in an excel spreadsheet. How can I convert the above data into ...

JavaScript tree functionality without framework

I'd like to display a tree on a Facebook page with JavaScript. Therefore there can be no dependencies on frameworks such as jQuery or Ext which won't run on Facebook, at least as far as I know when I last worked on that platform (April 2009). Can anybody recommend a "framework-free" JavaScript/tree library? I have ported some fairly c...

Multiple tables in nested sets hierarchy

I have a number of distinct items stored in different MySQL tables, which I'd like to put in a tree hierarchy. Using the adjacency list model, I can add a parent_id field to each table and link the tables using a foreign key relationship. However, I'd like to use a nested sets/modified preorder tree traversal model. The data will be use...

should a tree node have a pointer to its containing tree?

I'm building a gui component that has a tree-based data model (e.g. folder structure in the file system). so the gui component basically has a collection of trees, which are just Node objects that have a key, reference to a piece of the gui component (so you can assign values to the Node object and it in turn updates the gui), and a coll...

How can I view the version tree for a file in SVN which shows the merges from branches back to trunk?

Hi, I'm new to SVN but have used Clearcase for years. My issue is I have some changes on a branch which I have merged back to trunk using TortoiseSVN "Reintegrate a branch" feature. Now when I look at the version tree I don't see any edge being rendered from the tip of the branch to the tip of the trunk, which I would expect to see. I...

How can I construct a family tree with Perl?

I have a programming assignment in Perl that requires me to do the following: Creates a table in a mySQL database, and inserts these records into it: Loads the data from the table into an array of instances of class Son. Using the array, creates HTML code representing a father-son tree, and prints the html code to STDOUT. It's not nece...

How do I find a matching subtree?

I have a large binary tree, T. T "matches". Some number of subtrees of T will also match. In fact, the matching subtrees need not even be full subtrees: they can be truncated, too. By truncated subtree, I mean that nodes in the subtree may not contain children all the way down - some nodes that have children may have their children r...

CSS Accordion/Tree Menu with 100% width dividers

I want to create a CSS/JS accordion menu, with HTML like so: <ul> <li><a href="#">First Link</a> <ul> <li><a href="#">Child One</a></li> <li><a href="#">Child Two</a></li> </ul> </li> <li><a href="#">Second Link</a></li> <li><a href="#">Third Link</a></li> </ul> The nav structur...

SQL Server Tree Hierarchy and Nested Sets with Duplicate Record ids

Given that I have this resultset structure (superfluous fields have been stripped) Id | ParentId | Name | Depth ---------------------------- is it possible to have the records returned in tree order i.e. Parent then Children, if a Child is a Parent, then their Children, if not then Sibling, etc? For example, Id | ParentId | Name | De...

To show directory structure as a tree similarly as Pstree

I would like to see my current directory structure as a tree such that no directories below the current directory is shown, similarly as Pstree: I did not find an option for that from ls in OS X Leopard. How can you make a tree of your current directory structure in terminal? ...

Put linq to sql results into hierarchical structure for using in a un-ordered list ( for jquery tree )

I have 5 tables in a L2S Classes dbml : Global >> Categories >> Sub-Category >> Item >> Item Data. I want to be able to navigate from the Global table down a tree like structure to get to the items - displaying the title from the Item Data table. I have an existing control that uses a IHierarchyData / IHierarchicalEnumerable extended co...

How are regular and composite indexes implemented in RDBs?

In databases like MySQL or Oracle, how are indexes implemented? I think regular indexes are stored as B-trees, but couldn't find anything about composite indexes that index on multiple columns. I'm looking for the names of the data structures used so I can research them. More generally, where can I find more such information about datab...

Hilbert tree: Does anyone know where to find a code implementation of this?

I'm looking for the code or even a visual demo on how this tree works. I have read this paper on Hilbert R-Trees and tried to implement the algorithms stated I get lost when I have to adjust the tree with the sets, as well as not sure on most other things. It doesn't matter what language if there is an implementation as it will be used...

SQL "tree-like" query - most parent group

I'm having some trouble doing a "tree-like" query (what do we call this?) in SQL. Take a look at my diagram below (table and column names are in danish - sorry about that): Using MSSQL Server 2005, the goal is to find the most parent group (Gruppe), for each customer (Kunde). Each group can have many parent groups and many child grou...

slow construction of tree structure from XML

I'm parsing an XML document into my own structure but building it is very slow for large inputs is there a better way to do it? public static DomTree<String> createTreeInstance(String path) throws ParserConfigurationException, SAXException, IOException { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstanc...

reconstructing a tree from its preorder and postorder lists.

Consider the situation where you have two lists of nodes of which all you know is that one is a representation of a preorder traversal of some tree and the other a representation of a postorder traversal of the same tree. I believe it is possible to reconstruct the tree exactly from these two lists, and I think I have an algorithm to d...

What datatype/structure to store file list info?

I have an application that searches files on the computer (configurable path, type etc). Currently it adds information to a database as soon as a matching file is found. Rather than that I want to hold the information in memory for further manipulation before inserting to database. The list may contain a lot of items. I consider performa...

SVN: set properties on directories only

In SVN is there any way to set (bugtraq) properties on all directories in a tree without checking out the whole tree? I can't set properties in the repository directly without setting hooks. Even if I could I'm not sure this would help - you can't set recursive properties with Tortoise, and I suspect it wouldn't be straightforward with ...

SQL Find all direct descendants in a tree

I have a tree in my database that is stored using parent id links. A sample of what I have for data in the table is: id | name | parent id ---+-------------+----------- 0 | root | NULL 1 | Node 1 | 0 2 | Node 2 | 0 3 | Node 1.1 | 1 4 | Node 1.1.1| 3 5 | Node 1.1.2| 3 Now I would like to get a list o...

Flex AdvancedDataGrid Tree Custom Drag

I'd like to implement a custom drag on an AdvancedDataGrid tree structure, which only allows the drag on the branches (not leaves). I'm having much difficultly with this, trying to use the MouseDown event, but not having luck! Okay, I think I've got the mousedown able to figure out if the item is a branch of leaf. Any help on how to ...