Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void insertLast(int num, Lista *lista){
- Lista nuevo = (Lista)malloc(sizeof(Node));
- nuevo -> n =(int)malloc(sizeof(int));
- nuevo -> n = num;
- nuevo -> next = NULL;
- Lista aux = *lista;
- if(aux){
- while(aux->next){
- aux=aux->next;
- }
- aux->next=nuevo;
- return;
- }
- else{
- *lista = aux;
- }
- }
- Lista removeFirst(Lista hola){
- return hola->next;
- }
- void removeLast(Lista *hola){
- Lista aux = *hola;
- while((aux->next)->next)
- aux = aux -> next;
- aux->next = NULL;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement