The code has successfully compiled but it is not passing any of the test case
Test cases are not passing
void display(node* head) {
node* temp = head;
while (temp != NULL) {
cout << temp->data << " ";
temp = temp->next;
}
}
u were not printing the list in the desired fashion