tree

how to build a 3statetree in flex

hi all I want build a 3statetree with checkbox,I had got the resource from cookbook,but I don't know how to use it with json, and how can i click one node then send the request to server and expand the subnode after receive the json data from server. thank you,thank you. ...

Tree structure category sum that cascades to root node.

Hi All, I'm going to come right out and say that I am not the worlds greatest Mathematician :D So this problem may well be simple to most of you. Unfortunately it's confusing me and have had several stabs at a workable solutions. As with any tree, one can have many branches, many branches can have more branches and so forth until they ...

Alpha Beta Searching and Transposition Tables

I have alpha beta search working and want to implement transposition tables to make it faster. The problem I'm having is the relationship between the entries in the table and the current position being evaluated. The literature I've read so far says you need to store the position type, the score, and some other information. Why do you h...

C : Store and index a HUGH amount of info! School Project

Hi, i need to do a school project in C (I'm really don't know c++ as well). I need a data struct to index each word of about 34k documents, its a lot of words, and need to do some ranking about the words, i already did this project about 2 years ago (i'm pause in the school and back this year) and a i use a hash table of binary tree, bu...

Why are Binary Trees Important?

Why we do we study binary trees specifically? As in a general m-way search tree is not given as importance as binary trees in DataStructure textbooks. Does the use of a binary tree exceed m-way trees? ...

KD-Tree traversal (raytracing) - am I missing a case?

Hi! I'm trying to traverse a 3D KD-Tree in my raytracer. The Tree is correct, but there seems to be something wrong with my traversal algorithm since I'm getting some errors compared to using a brute-force approach (some small surface areas seem to get ignored). Note: none of the rays in question is parallel to any axis. This is my tra...

search a Binary search tree

I am trying to find a name within a key. I think it is retrieving it fine. however, its coming up as not found. maybe my code is wrong somewhere? if (database.retrieve(name, aData)) // both contain the match in main() static void retrieveItem(char *name, data& aData) { cout << ">>> retrieve " << name << endl << endl; if (database.re...

MongoDB nested sets

What're the best practices to store nested sets (like trees of comments) in MongoDB? I mean, every comment can have a parent comment and children-comments (answers). Storing them like this: { title: "Hello", body: "Please comment me!", comments: [ { author: "Peter", text: "Hi there", ...

Problem searching a Binary Search Tree - Array Based

I am trying to search for a word using a key value recursively. In retrieve function: Problem is the index goes from 0, 1,3,7, to 15.... it suppose to go 0,1,3,7,8 and so forth I have the insert working as expected. I have the inorder, preorders, all working. Can someone please help me figure out this problem? I have been working on this...

How would you convert this mutable tree into an immutable one?

How would you convert type Node into an immutable tree? This class implements a range tree that does not allow overlapping or adjacent ranges and instead joins them. For example if the root node is {min = 10; max = 20} then it's right child and all its grandchildren must have a min and max value greater than 21. The max value of a rang...

Need help with Binary Search Tree in C++

I'm trying to make a BST and need to print it inorder, postorder, and preorder The thing am not sure about is how to create this tree in my main() function. struct Tree_Node { Tree_Node *right; Tree_Node *left; int info; }; class bTree { private: Tree_Node *root; public: bTree(); void bTree::Insert(Tree_Node*& ...

Parsing line and selecting values corresponding to a key

there is a set of data which is arranged in a specific manner (as a tree), as is given below. basically a key=value pair, with some additional values at the end, which informs how many children does the branch have and some junk value. 11=1 123 2 11=1>1=45 234 1 11=1>1=45>9=16 345 1 11=1>1=45>9=16>2=34 222 1 11=1>1=45>9=16>2=34>7=0 2234...

Illegal cyclic loop between nodes?

I am trying to loop through an XML file. As for the first loop everything works fine, but when the program enters the second loop it gives an error saying that TypeError: Error #1118: Illegal cyclical loop between nodes. at XML/http://adobe.com/AS3/2006/builtin::appendChild() Can anyone help me regarding this issue and suggest how to ...

Flex tree control drag drop .item position

hi guys, just facing a difficulty with tree control drag drop.. Suppose i have tree with drag-drop enabled. I want to which node(id) is droped inside which node. 1]if i drag "Cat1" node inside "Cat3",i want to identify ids of siblings of "cat1",and "cat3". 2]in general i want to know the ids of current element being moved along wit...

Most efficient tree structure for what I'm trying to do

I'm wondering what the most generally efficient tree structure would be for a collection that has the following requirements: The tree will hold anywhere between 0 and 232 - 1 items. Each item will be a simple structure, containing one 32-bit unsigned integer (the item's unique ID, which will be used as the tree value) and two pointers...

Prolog - recursing down family tree

I am trying to write a Prolog program that will print out the male successors of British Royalty in order. My attempt so far: son(elizabeth, charles). son(charles, william). son(charles, henry). son(elizabeth, andrew). son(elizabeth, edward). son(edward, severn). successor(X, Y) :- son(X, Y). successor(X, Y) :- son(X, C), successor(C, Y...

Best open-source javascript tree?

Could you propose open source, but commercial-friendly licensed (non-GPL) Javascript trees? Please take into account that I need it for an existing Web application, so I am not sure whether other tools such as GWT or Echo would be appropriate. I have already checked: Dojo Tree jQuery.Dynatree.js (JQuery) JSTree (JQuery) Mif.Tree (Moo...

Why there is no tree tag in html?

Hi, I wonder why there is no tree tag in html? Something like table tag. For example: <tree> <treenode id=root> <treenode id=child1 /> <treenode id=child2> <treenode id=child2-1> ...... </treenode> </treenode> </treenode> </tree> ...

Most elegant/safe/easy solution to store and edit (GUI) a directory-like tree structure?

Hello, I've got a slightly tricky problem to solve; imagine this: One of my applications needs to make heavy use of scripting, so my idea was to provide the user a way to write script snippets and organize them in a directory-like tree structure. This is much like a source code directories with subdirectories and source files. Data Cl...

Distributing tree structures

For example, I have a large set of bulletins which are organized in a tree (category tree). All categories inclusive. So if I watching items in category A, I'm also see all items in subcategories of this category A. And if I'm watching at root I'm see all the bulletins. I want to achieve horizontal scalability here, because of large siz...