// ovde je parametar metoda tipa T public void DodajNaPocetak(T t) { CvorListe n = new CvorListe(t); n.Sledeci = glava; glava = n; }
public IEnumerator <T> GetEnumerator() { CvorListe current = glava; while (current != null) { yield return(current.Podatak); current = current.Sledeci; } }
// konstruktor liste public JednostrukoPovezanaLista() { glava = null; }
// ovde se parametar tipa T koristi u negenerickom konstruktoru public CvorListe(T t) { sledeci = null; podatak = t; }