Linked list operator overloading

output is not coming
#include
using namespace std;
class node{
public:
int data;
node *next;
node(int d){
data=d;
next=NULL;
}
};
void insertAtTail(node *&head,int data){
if(head==NULL){
head = new node(data);
return;
}
node *tail=head;
while(tail->next!=NULL){
tail=tail->next;
}
tail->next=new node(data);
return;12

}
void buildInput(node *&head){
int data;
cin>>data;
while(data!=-1){
insertAtTail(head,data);
cin>>data;
}
}
void print(node *head){
while(head!=NULL){
cout<data<<"->";
head=head->next;
}
cout<<endl;
}
istream& operator>>(istream &is, node head){
buildInput(head);
return is;
}
ostream& operator<<(ostream &os, node
head){
print(head);
return os;
}
int main(){
node *head1=NULL;
node *head2=NULL;
/buildInput(head);
print(head);
/
cin>>head1>>head2;
cout<<head1<<endl<<head2;
return 0;
}

@ayu2321 hey I have corrected your code,please check 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.

please rectify my code…i am not getting your code at all

@ayu2321 hey pls check the operator overloading functions in my code,they are all correct,you will find your mistake.

i thik u have shared the different code please check once…

@ayu2321 hey I have send code in which all functions related to linked list are there ,you pls just check the overloading function which is in last,you will get it.

this is the code u have send
#include
#include <unordered_map>
#include
#include
using namespace std;

bool compare(int a ,int b ){
    return a>b;
}



int main(){
	int n;
	cin>>n;

	//int* arr = new int[100000];
	unordered_map<int,int> mp;
	vector<int> v;
	for(int i=0;i<n;i++){
		int x;
		cin>>x;

		if(mp.count(x)){
			mp[x] = i;
		}
		else{
			mp[x] = i;
			v.push_back(x);
		}

	}
// sort(v.begin(),v.end(),compare);
    sort(v.begin(),v.end());

	for(auto p:v){
		cout<<p<<endl;
	}



}

@ayu2321 hey so sorry ,code was not saved ,check this pls: