¡GoConqr estrena diseño! Cuéntanos qué te parece.

Fichas

Delete a node with a key

Suhas S Inglés 1 ficha

Fichas del conjunto (1)

  1. 1Delete all occurrences of a key in a linked listpublic void deleteKey(ListNode head, int key){
    ListNode temp = head;
    ListNode = prev;
    while(temp != null && temp.data ==key){
    head = temp.next;
    temp= head;
    }
    while(temp!=null){
    while(temp!=null && temp.data!=key){
    prev = temp;
    temp= temp.next;
    }
    if(temp == null) return;
    prev.next = temp.next;
    temp = prev.next;
    }
    }

Información

Descripción
Fichas sobre Delete a node with a key, creado por Suhas S el 15/02/2018.
Creado por
Suhas S
Visitas
11
Etiquetas
linkedlist
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?