Getting noting output

u have taken the i/p for the 2nd array incorrectly
cin >> m;
for(int i = 0 ; i < m ; i++)
cin >> b[i];

line 19
node* root=new node(a[i++]);
incremenet i here and not on line 27