Please debug code

Question is to convert bst to minheap.
MY ATTEMPT:-

#include
#include
using namespace std;

class Node{
public:
int data;
Nodeleft;
Node
right;
Node(int d){
Noden=new Node(d);
left=NULL;
right=NULL;
}
};
Node
constructTree(){
cout<<“Enter”<<endl;
int d;
cin>>d;
if(d==-1){
return NULL;
}
Node* n=new Node(d);
n->left=constructTree();
n->right=constructTree();
return n;
}

void inorder(vector &v,Node*root){
if(root==NULL){
return;
}
inorder(v,root->left);
v.push_back(root->data);
inorder(v,root->right);
}

void solve(vector v,Node* &root){
static int i=0;
if(root==NULL) return;
if(i<v.size()){
root->data=v[i];
i++;
}
solve(v,root->left);
solve(v,root->right);
}
void bfs(Node *root)
{
if (root == NULL) return;

// Create an empty queue for
// level order traversal
queue<Node *> q;
  
// to store front element of 
// queue.
Node *curr;

// Enqueue Root and NULL node.
q.push(root);
q.push(NULL);

while (q.size() > 1)
{
    curr = q.front();
    q.pop();
      
    // condition to check 
    // occurrence of next 
    // level.
    if (curr == NULL)
    {
       q.push(NULL);
       cout << "\n";
    }
      
    else {
          
        // pushing left child of 
        // current node.
        if(curr->left)
        q.push(curr->left);
          
        // pushing right child of
        // current node.
        if(curr->right)
        q.push(curr->right);
          
        cout << curr->data << " ";
    }
}

}

int main(){
Node*root=NULL;
vector v;
root=constructTree();
inorder(v,root);
solve(v,root);
bfs(root);
return 0;
}

hi… pls save ur code on ide and send…

If u still have any doubts u can refer to my code https://ide.codingblocks.com/s/268900

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.