GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Karteikarten

Delete a node with a key

Suhas S Englisch 1 Karte

Karten in diesem Stapel (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;
    }
    }

Informationen

Beschreibung
Karteikarten am Delete a node with a key, erstellt von Suhas S am 15/02/2018.
Erstellt von
Suhas S
Aufrufe
11
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck