Sponsored Content
Top Forums Programming which stl is best suited to represent a tree Post 302446054 by fpmurphy on Tuesday 17th of August 2010 01:38:25 PM
Old 08-17-2010
Probably std::map - which is usually based on a red black tree.
This User Gave Thanks to fpmurphy For This Post:
 

7 More Discussions You Might Find Interesting

1. Programming

STL map

Hi there, I am using the STL map and I print the map using: map <string, float> ngram_token_index ; map <string, float>::iterator map_iter ; //read the map ... // print the map for ( map_iter = ngram_token_index.begin() ; map_iter != ngram_token_index.end() ; map_iter++ ) cout << ... (2 Replies)
Discussion started by: superuser84
2 Replies

2. Programming

STL from win

Help me please with STL source code that works on Windows I've found on Inet STL MRU Cache (it compiles fine with Studio 2008), but when trying to build it with Kdevelop (g++ is the compiler) I've got a series of error. One of them I've placed in the source code. If it's important I can post here... (0 Replies)
Discussion started by: Orlando_ua
0 Replies

3. UNIX for Dummies Questions & Answers

c++ stl which rpm?

Hello, I'm using RHEL 5.3, I need to compile C++ code and I'd like to know which rpm contains the STL library. Thanks:) (3 Replies)
Discussion started by: pppswing
3 Replies

4. Programming

stl map - could any one explain the o/p

class tst { public: tst() { cout<<"ctor tst()\n"; } tst(const tst& ob) { cout<<"cp ctor tst()\n"; } ~tst() { cout<<"dtor tst()\n"; } }; map<string,tst> mp; int main(void) { mp; //mp=tst(); } (1 Reply)
Discussion started by: johnbach
1 Replies

5. Programming

Which language is best suited for regular expressions perl,python.ruby ?

Hello all, i am in a bit of dilema here. i dont know any thing about perl or python. only know a little bit of awk. now unable to take a decission as to which language to go for. my requirement is building a testing framework.suite which will execute ssytem comands remotely on unix... (2 Replies)
Discussion started by: achak01
2 Replies

6. Programming

c++ code to print a tree using stl map

hi all, i need c++ code to print a binary or non binary tree using stl map.... please help me to find the same.......... (1 Reply)
Discussion started by: vidyaj
1 Replies

7. Programming

STL transform question

Hi all, I pass to the transform algorithm two vectors, and the suma function. #include <algorithm> #include <iostream> #include <iterator> #include <vector> using namespace std; class Duo{ public: int one; int two; }; Duo suma(Duo first, Duo last){ Duo ret; ... (1 Reply)
Discussion started by: santiagorf
1 Replies
Blt_TreeCreateNode(3)					      BLT Library Procedures					     Blt_TreeCreateNode(3)

__________________________________________________________________________________________________________________________________________________

NAME
Blt_TreeCreateNode - Creates a node in a tree data object. SYNOPSIS
#include <bltTree.h> Blt_TreeNode Blt_TreeCreateNode(tree, parent, name, position) ARGUMENTS
Blt_Tree tree (in) Tree containing the parent node. Blt_TreeNode parent (in) Node in which to insert the new child. const char *name (in) Node label. If NULL, a label will automatically be generated. int position (in) Position in the parent's list of children to insert the new node. _________________________________________________________________ DESCRIPTION
This procedure creates a new node is a tree data object. The node is initially empty, but data values can be added with Blt_TreeSetValue. Each node has a serial number that identifies it within the tree. No two nodes in the same tree will ever have the same ID. You can find a node's ID with Blt_TreeNodeId. The arguments are as follows: tree The tree containing the parent node. parent Node in which the new child will be inserted. name Label of the new node. If name is NULL, a label in the form "node0", "node1", etc. will automatically be generated. Name can be any string. Labels are non-unique. A parent can contain two nodes with the same label. Nodes can be relabeled using Blt_TreeRe- labelNode. position Position the parent's list of children to insert the new node. For example, if position is 0, then the new node is prepended to the beginning of the list. If position is -1, then the node is appended onto the end of the parent's list. RETURNS
The new node returned is of type Blt_TreeNode. It's a token that can be used with other routines to add/delete data values or children nodes. EXAMPLE
The following example creates a new node from the root node. Blt_Tree token; Blt_TreeNode root, node; if (Blt_TreeGetToken(interp, "myTree", &token) != TCL_OK) { return TCL_ERROR; } root = Blt_TreeRootNode(token); node = Blt_TreeCreateNode(token, root, "myNode", -1); NOTIFICATIONS
Blt_TreeCreateNode can trigger tree notify events. You can be notified whenever a node is created by using the Blt_TreeCreateNotifyHan- dler. A callback routine is registered that will be automatically invoked whenever a new node is added via Blt_TreeCreateNode to the tree. KEYWORDS
tree, token BLT
2.4 Blt_TreeCreateNode(3)
All times are GMT -4. The time now is 11:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy