Generation

generate functionSun, 02 Apr 2023

Nodo que elimine

#include<iostream> using namespace std; struct node{char data; struct node *next;}; node *head=NULL; void insert(char x){ node *temp=new node; temp->data=x; temp->next=NULL; } void print(){ node *temp=head; while(temp!=NULL){ cout<<temp->data<<endl; temp=temp->next; } } void del(char x){ node *temp=head; if(temp==NULL){cout<<"Lista Vacia"<<endl;return;} if(temp->data==x){head=temp->next; return;} node *temp2=temp->next; while(temp2!=NULL){ if(temp2->data==x){ temp->next=temp2->next; return; } temp=temp2; temp2=temp2->next; } cout<<"No

Questions about programming?Chat with your personal AI assistant