Find error in code

My code is showing runtime error

#include
#include
#include
#include
using namespace std;

class Node{

public:
int data;
Node* left;
Node* right;

Node(int d){
    data = d;
    left = NULL;
    right = NULL;
}

};

Node* createFromPreTrav(int* pre,int* in,int s,int e)
{
static int i=0;
// static var is only initialised once irrespective of multi func calls

if(s>e)
    return NULL;

Node* root = new Node(pre[i]);

// search for given node in inorder array
int index=0;

for(int j=s;j<=e;j++)
{
    if(in[j]==pre[i])
    {
        index=j;
        break;
    }
}    

// building left and right subtrees recursively
root->left = createFromPreTrav(pre,in,s,index-1);
root->right = createFromPreTrav(pre,in,index+1,e);

return root;

}
void bfs(Node* root){

queue<Node*> q;
q.push(root);
q.push(NULL);

while(!q.empty()){

    Node* n = q.front();
    if(q.front()==NULL){
        cout<<endl;
        q.pop();

        if(!q.empty())
            q.push(NULL);
    }
    else{
        cout<<q.front()->data<<", ";
        q.pop();

        if(n->left)
            q.push(n->left);
        if(n->right)
            q.push(n->right);
    }
}

return;

}

void Print(Node * root){

if(root==NULL){
    cout<<endl;
    return;
}

// else print value of node and call next
cout<<root->data<<" ";
Print(root->left);
Print(root->right);   

}

// level order printing

// calc heights

int main()
{
int pre[] = {3,2,8,4,1,6,7,5};
int in[] = {1,2,3,4,8,5,6,7};

int e= sizeof(in)/sizeof(int);

Node* root = createFromPreTrav(pre,in,0,e-1);
Print(root);

return 0;

}

kindly share the link of code
so that i can also check your code by running it

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.