delete(q)
Natijadaro‘yhatquyidagiko‘rinishgaegabo‘ladi:
12-rasm. Natijaviy ro‘yhat ko‘rinishi
Shu algoritm dasturi:
Node* p = lst;
Node* q = new Node;
int k;
cout<<"k=";cin>>k;
for(int i=0;inext;
q = p->next;
p->next = q->next;
delete(q);
Dostları ilə paylaş: