matheus__serpa icon

prova-sub-q1

matheus__serpa | PRO | 06/30/20 08:27:35 PM UTC | 0 ⭐ | 3073 👁️ | Never ⏰ | []
C |

410 B

|

None

|

0 👍

/

0 👎

    void funcao(Nodo **lista, int info){
        int aux = 1;
        Nodo *no1, *no2 = NULL;
        if(info == 1){
           no2 = *lista;
           *lista = no2->prox;
        }else{
            for(no1 = *lista; no1->prox != NULL; no1 = no1->prox){
                aux++;
                if(aux == info)
                    break;
            }
            no2 = no1->prox;
            no1->prox = no2->prox;
        }
        free(no2);
    }

Comments