CoboCards App FAQ & Wishes Feedback
Language: English Language
Sign up for free  Login

This flashcard is just one of a free flashcard set. See all flashcards!

All main topics / Informatik / Algorithmen & Datenstrukturen / ADS
15
Listen /Implementierung
public int anzahlVorkommen(int gesucht){
       int zaehler = 0;
       Element e = erstes;
       while (e != null){
           if (e.wert == gesucht){
              zaehler ++;
           }
          e = e.naechst;
      }
      return zaehler;
}


public void addLast(int zahl){
      ListElem neu = new ListElem();
      neu.wert = zahl;
      neu.naechst = null;
      if (erstes == null){
         erstes = neu;
      } else {
         Element e = erstes;
         while (e.naechst != null){
                 e = e.naechst;
          }
          e.naechst = neu;
}    


--
New comment
Flashcard info:
Author: hristiana86
Main topic: Informatik
Topic: Algorithmen & Datenstrukturen
School / Univ.: HS
City: Mannheim
Published: 14.06.2010

Cancel
Email

Password

Login    

Forgot password?
Deutsch  English