Is this the efficient way of making linked list

#include<bits/stdc++.h>
#define ll long long int
#define MM endl
using namespace std;
class node{

public:
int data;
node*next;
node(int val)
{
data=val;
next=NULL;
}
};

void insertAtTail(node*&head,int val)

{
noden=new node(val);
if (head==NULL)
{
head=n;
return;
}
node
temp=head;
while (temp->next!=NULL)
{
temp=temp->next;
}
temp->next=n;
}

void display(node*&head)
{
node*temp=head;
while (temp!=NULL)
{
cout<data<<" ";
temp=temp->next;
}
}

int main()
{
node*head=NULL;
int n;
cin>>n;
for (int i = 0; i < n; i++)
{
int data;
cin>>data;
insertAtTail(head,data);
}
display(head);
}