Boost logo

Boost Users :

From: Terje Slettebų (tslettebo_at_[hidden])
Date: 2003-06-09 16:58:56


>From: "Hossein Haeri" <powerprogman_at_[hidden]>

> In fact, the tree I want to represent is just a
> hierarchy. The only fact that I know about this
> hierarchy is the parent/child relationship.

This still makes it hard to come up with a solution for it, because you
don't say what operations are needed on the tree, or how many children there
are - although you said _binary_ search tree, but as others have pointed
out, with the tree being unordered, it's no longer a search tree, so one may
wonder if the binary part is correct, too.

Given your current description of what you want, here's one that satisfies
it:

template<class T>
struct tree_node
{
  T data;
  tree_node *left;
  tree_node *right;
};

This isn't intended to be sarcastic, but rather to point out that so far
you've provided way too little information about what you want to do with
the tree, to be able to give a meaningful reply (other than the links to
present libraries).

Regards,

Terje


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net