Node* Insert(Node *head,int data)
{
Node *node = new Node;
node -> data = data;
if (head == NULL) {
return node;
}
else {
Node *last = head;
while (last -> next != NULL) {
last = last -> next;
}
last -> next = node;
return head;
}
}
Error: Solution.cpp:69:1: error: ‘Node’ does not name a type; did you mean ‘modf’? Node* Insert(Node *head,int data) Solution.cpp: In function ‘int main()’: Solution.cpp:104:41: error: ‘insertNodeAtTail’ was not declared in this scope
Aucun commentaire:
Enregistrer un commentaire