Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- nodo* G(nodo* L, int x)
- {
- nodo* k = L;
- if(k)
- {
- if(k->next==0)
- {
- if(k->info==x)
- {
- delete L;
- }
- else
- {
- return L;
- }
- }
- else
- {
- while(k->next)
- {
- if(k->info==x)
- {
- nodo* y = k;
- k = k->next;
- delete y;
- }
- else
- {
- if(k->next->info==x)
- {
- nodo* y = k->next;
- k->next = k->nxt->next;
- delete y;
- }
- else
- {
- k = k->next;
- }
- }
- }
- return L;
- }
- }
- }
Add Comment
Please, Sign In to add comment