tree

listing a folder content : how to prevent user from going above the authorized directory?

Hi, i'm working on a script to allow users to browse a given directory, which is not the directory this file is sitting in, but set in a variable. define('FOLDER', '../_files/'); Now, the rendred html allows to navigate subfolders inside that folder. I use a "dir" GET variable to tell my script which subfolder's content to display a...

Tree Data Structure

I am looking for a tree implementation... you can see the me previous question here. but I won't like to implement it myself, example functionalities needed: I need FindElement(node) I need GetParent(node) - will do the find again GetSubTreeFrom(node) - will find the element and return a subtree.. I know C5 - but all the trees there...

Basic tree in Python with a Django QuerySet

Here's where I'm exposed as the fraud of a programmer I am. I've never created a data tree. Basically, I have a table with four fields: A, B, C, and D. I need to create a tree of unordered lists based on these fields. Ultimately, it would look something like this: A1 B1 C1 D1 D2 C2 D3 D4 B2 C2 D5 D6 C3 D7 D8 A2 B2 C1...

To restrict a node from `tree` by Tree or Git

How can you restrict a node from the command tree? #1 I need to give a tree of my project files reqularly for my supervisor. These files contain some third-party components which I do not want to show in the tree. I have solved this problem this far by coping the project file to tmp, removing 3rd party-files and then running tree. How...

How to determine the height of a recursion tree from a recurrence relation?

How does one go about determining the height of a recursion tree, built when dealing with recurrence run-times? How does it differ from determining the height of a regular tree? edit: sorry, i meant to add how to get the height of the recursion tree from the recurrence relation. ...

The possible number of binary search trees that can be created with N keys is given by the Nth catalan number. Why?

This has been bothering me for a while. I know that given N keys to arrange in the form of a binary search tree, the possible number of trees that can be created correspond to the Nth number from the Catalan sequence. I have been trying to determine why this is; unable to find anything that might even attempt to explain it intuitively ...

Generic tree implementation in Java

Is anyone aware of a generic tree (nodes may have multiple children) implementation for Java? It should come from a well trusted source and must be fully tested. It just doesn't seem right implementing it myself. Almost reminds me of my university years when we were supposed to write all our collections ourselves. EDIT: Found this pro...

How to display XML in a HTML page as a collapsible and expandable tree using Javascript?

How to display a XML document in a HTML page as a collapsible and expandable tree? I'd like to display a XML document inside a HTML page as a nicely pretty printed tree structure. I'd like to be able to expand and collapse tree branches. For example Firefox browser does this when you load a plain XML file. Surely there is a some kind o...

Best .NET library for trees

What is the best .NET library (commercial or open source) that implements a non-binary tree and its associated operations? The requirements are to dynamically insert and delete nodes, copy/paste nodes, find information buried in nodes, copy/paste of folders and their children from one area of the tree to another. The tree is at the busin...

Flex Tree Display Custom Data - DataDescriptor?

I am trying to have a tree display custom data that looks like this. ID DATA PARENT SORT a ... 10 aa ... a 10 ab ... a 20 b ... 20 c ... 30 It would look like this in xml <root> <a> <aa/> <ac/> </a> <b/> <c/> </root> I don't wa...

Python: manipulating sub trees

I'm a nooby. I'd like to acknowledge Allen Downey, Jeffrey Elkner and Chris Meyers and 'How to think like a computer scientist' for what I know. I'm building a genetics inspired program to generate equations that match some provided problem. The node class looks like this: class Node(object): ''' ''' def __init__(self, car...

jQuery treeview with sortable

Hi there, I was just wondering if anyone knows of any way to get the bassistance treeview plugin to work with jQuery UI's sortable plugin? Particularly in terms of being able to drag and drop the element from it's nested ul to the parent ul or vice versa. Two other requirements are that I have the ability to prevent dropping onto specif...

Knowing when a Flex MX Tree component is done rendering the children

I have a component in Flex Builder, and the dataprovider to this Tree is a ArrayCollection. I update the ArrayCollection dynamically, and the Array can become really big. What I now really need to know is when Flash is done rendering the Tree component, is there som Complete event that triggers when the Tree is ready, or some other wa...

State Machine Implementation

I'm looking for some general Optimization Correctness Extensibility advice on my current C++ Hierarchical State Machine implementation. Sample variable isMicOn = false variable areSpeakersOn = false variable stream = false state recording { //override block for state recording isMicOn = true //here, only isMicOn is...

Deterministic handle allocation algorithm

I'm trying to find an efficient deterministic way of allocating a 32-bit handle in such a way that it will operate indefinitely. A simple incrementing counter will not work because it will eventually loop around. Extending to 64-bits isn't possible because the values will be used in a network protocol which is expecting a 32-bit value. ...

Unit test proper data structure creation

How would one test whether data structure built properly? I'm implementing kind of modified radix tree, and been wondering how do you check if your data structure builds up correctly. Consider a tree of TreeNode {String, Int} nodes. You always want to append new child to deepest node of value equal to 0, as in following example: Root,...

How to display large amount of data fast

I have a large database table that I need to display on a Windows Form. The data is some sort of a "category list" which I need to display to the user in a treeview-like structure, there are categories with more sub-categories. Treeview control has delay loading but the problem is there could be hundred thousand root nodes with 4 column ...

How to create a tree structure in Javascript DOM?

Hi, This is going to sound too silly / too basic - sorry about that, but I experimented a lot and couldn't come to the right solution! I'm using this following piece of code - which makes a row of text fields go up and down. Unfortunately, the up and down movement doesnt stop and carries on throughout the page! :) function up(row) { ...

Changing the value of a node in an asynchronous TreeView

I have a treeview using BackGround worker to add nodes when you expand any. I display a "Loading.." message after the expand and remove it after the nodes are loaded. It works fine and all. Now I want to change the loading message to "Loading...node n/n". I was able to do it but the problem is this message is not displayed(updated to) wh...

Depth first search using java

I want to implement DFS (Depth first search) and BFS using java. Does java have a built in tree data structure that I can use readly? Or any other thing that I can use? ...