Placement in unordered trees??

Hi, as the title says, i want to write a recursive function that implements a full or quite full tree by inserting one int at a time..
this is the classes that i use:

template <class T>
class nodo{
public:
nodo();
nodo(T x);
nodo(const nodo<T>&);
~nodo(){};
nodo<T> *right;
nodo<T> *left;
T info;
};

this is the cass nodo.



template <class T>
class tree{
public:
tree();
//tree(const tree<T> &);
~tree();

void insert(T); //this is the extern function to call to insert in unordered way. just implemented. it simply calls insert_in_tree_not_order(nodo<T>*,T).

void insert_in_order(T); //already implemented
bool search(T); //already implemented
T get_min(); //already implemented
T get_max(); //already implemented
void print(); //already implemented
void delete_elem(T); //already implemented
bool is_empty(); //already implemented
private:
nodo<T>* search_min(nodo<T>*); //already implemented
nodo<T>* search_max(nodo<T>*); //already implemented
nodo<T>* insert_in_tree_not_order(nodo<T>*,T); //this is the function that really improve the unordered insertion.
nodo<T>* insert_in_tree_in_order(nodo<T>*,T); //already implemented
void tree_destroy(nodo<T>*); //already implemented
void tree_print(nodo<T>*); //already implemented
nodo<T>* search_value(nodo<T>*,T); //already implemented
nodo<T>* delete_value(nodo<T>*,T); //already implemented
nodo<T> *root; //the tree's root

};

if someone can help me to implement the insert_in_tree_not_order(nodo<T>*,T) function...
if that can help you:

template <class T>
void tree<T>::insert(T info){
root = insert_in_tree_not_order(root,info);
}

it'is how i call the function.
Topic archived. No new replies allowed.