Click here to Skip to main content
16,005,339 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: list of VARIANT Pin
bojinyu12-Dec-02 18:07
bojinyu12-Dec-02 18:07 
GeneralRe: list of VARIANT Pin
bojinyu12-Dec-02 3:22
bojinyu12-Dec-02 3:22 
QuestionSTL Tree ? Pin
Nick Parker11-Dec-02 7:28
protectorNick Parker11-Dec-02 7:28 
AnswerRe: STL Tree ? Pin
Neville Franks11-Dec-02 9:25
Neville Franks11-Dec-02 9:25 
GeneralRe: STL Tree ? Pin
Nick Parker11-Dec-02 9:37
protectorNick Parker11-Dec-02 9:37 
GeneralRe: STL Tree ? Pin
Todd Smith12-Dec-02 11:36
Todd Smith12-Dec-02 11:36 
AnswerRe: STL Tree ? Pin
Paul M Watt13-Dec-02 5:26
mentorPaul M Watt13-Dec-02 5:26 
AnswerRe: STL Tree ? Pin
Jörgen Sigvardsson14-Dec-02 10:57
Jörgen Sigvardsson14-Dec-02 10:57 
Do you need a specialized tree such a binary search tree or a general n-tree?

A general n-tree can be hacked up as:

template <typename T>
struct Node {
    T data;
    Node* parent; // Optional member, can make navigation easier
    std::list<Node*> children;
};
 
// Then you can write simple functions like: 
template <typename T>
Tree_AppendChild(Node<T>* node, const T& value) {
   ...
}
 
template <typename T>
Tree_InsertChild(Node<T>* node, const T& value, int pos) {
   ...
}
// etc...


And then you could of course wrap all this into a single class if you want a more object-oriented approach.

N.B. you need to interpret (Node*)NULL as the base case - an empty tree.

--
Only in a world this sh*tty could you even try to say these were innocent people and keep a straight face.
QuestionHow do I raise events. Pin
acosmin11-Dec-02 3:15
acosmin11-Dec-02 3:15 
AnswerRe: How do I raise events. Pin
xi90412-Dec-02 2:07
xi90412-Dec-02 2:07 
GeneralSetSite Pin
suresh_sathya11-Dec-02 1:09
suresh_sathya11-Dec-02 1:09 
QuestionHow to use m_spClientSite Pin
hdi99kf@syd.kth.se6-Dec-02 2:42
hdi99kf@syd.kth.se6-Dec-02 2:42 
AnswerRe: How to use m_spClientSite Pin
geo_m6-Dec-02 5:25
geo_m6-Dec-02 5:25 
GeneralRe: How to use m_spClientSite Pin
Anonymous6-Dec-02 6:57
Anonymous6-Dec-02 6:57 
GeneralRe: How to use m_spClientSite Pin
geo_m6-Dec-02 8:39
geo_m6-Dec-02 8:39 
QuestionSTL Q : find_if = poop. any better? Pin
Chris Losinger5-Dec-02 15:50
professionalChris Losinger5-Dec-02 15:50 
AnswerRe: STL Q : find_if = poop. any better? Pin
Taka Muraoka5-Dec-02 16:07
Taka Muraoka5-Dec-02 16:07 
GeneralRe: STL Q : find_if = poop. any better? Pin
Chris Losinger5-Dec-02 18:27
professionalChris Losinger5-Dec-02 18:27 
GeneralRe: STL Q : find_if = poop. any better? Pin
Taka Muraoka5-Dec-02 18:42
Taka Muraoka5-Dec-02 18:42 
GeneralRe: STL Q : find_if = poop. any better? Pin
Chris Losinger5-Dec-02 19:23
professionalChris Losinger5-Dec-02 19:23 
GeneralRe: STL Q : find_if = poop. any better? Pin
markkuk7-Dec-02 2:15
markkuk7-Dec-02 2:15 
GeneralRe: STL Q : find_if = poop. any better? Pin
Chris Losinger7-Dec-02 13:28
professionalChris Losinger7-Dec-02 13:28 
AnswerRe: STL Q : find_if = poop. any better? Pin
Nick Parker5-Dec-02 17:12
protectorNick Parker5-Dec-02 17:12 
GeneralRe: STL Q : find_if = poop. any better? Pin
Chris Losinger5-Dec-02 18:08
professionalChris Losinger5-Dec-02 18:08 
GeneralRe: STL Q : find_if = poop. any better? Pin
Tim Smith6-Dec-02 2:25
Tim Smith6-Dec-02 2:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.