Duyệt Linked-list C++
Duyệt Linked-list C++
int main()
List l;
Khoitao(l); //khoi tao danh sach lien ket don
int n;
cout << "Nhap so luong node can them: ";
cin >> n;
for (int i = 0; i <n; i++)
{
int x;
cout << "Nhap gia tri so nguyen: ";
cin >> x;
Node* p = CreateNode(x); // create node so nguyen
ThemVaodau(l, p); //them node p vao dau danh sach lien ket don
}
return 0;
}