#ifndef NODE_BINARIO_H
#define NODE_BINARIO_H
# include "Colacircular.h"
# include <iostream>
using namespace std;
template<class T> struct Node_Binario // struct of node
{
T Dato;
Node_Binario<T> *left;
Node_Binario<T> *right;
int Profundida;
};
template<class T> // class tree
class Arbol
{
public:
Arbol(); //constructor
bool Insert(Node_Binario<T> * raiz,T item); // funtion insert
bool delet(T item); //funtion delete last node
bool preorden(Node_Binario<T> *root) // funcion return for preorder
void print();
private:
Node_Binario<T> *Root; //node root
int Altura; // acount the height
};
template<class T>
Arbol<T>::Arbol()
{
Root==NULL;
left==NULL;
right==NULL;
}
template<class T>
bool Arbol<T>::Insert(Node_Binario<T>* &raiz,
T item)
{
if(raiz==NULL)
{
raiz= new Node_Binario<T>(item);
}else if(raiz->left==NULL)
{
return Insert.(raiz->left);
}else if(raiz->right==NULL)
{
return Insert.(raiz->right);
}else
{
Node_Binario<T> *Q = new Node_Binario<T>(item)
}
}
I'm trying to make a complete binary tree nodes enter from left to right.
in the function insert my question is how to insert after the children of the root are not null but I do just want to recursively directed me to do