#include<iostream.h>
#include<conio.h>
#define NULL 0
class node
{
public:
int dt;
node *lt,*rt;
node(int x)
{
dt=x;
lt=rt=NULL;
}
};
class tree
{
public:
node *create();
int height(node*);
node *mirror(node *);
};
node* tree::create()
{
int x;
cout<<"enter data(-1 for no data)";
cin>>x;
if(x==-1)
return NULL;
node *t=new node(x);
cout<<"enter left child of"<<x;
t->lt=create();
cout<<"enter right child of"<<x;
t->rt=create();
return t;
}
plz tell me what exactly happens in stack when recursively creating first the left subtree and then the right subtree
i am well familiar with c++
but ia ma little weak in recursion
help greatly appreciated!!!