Revision: 60758
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at November 12, 2012 08:48 by mzivicnj
Initial Code
struct List { zivotinja value; List* next; }; typedef List Lista; typedef List* element; element FirstL(Lista *L) { return L; } element EndL(Lista *L) { while(L->next != NULL) { L = L->next; } return L; } element NextL(element P, Lista *L) { return P->next; } element PreviousL(element P, Lista *L) { while(L->next != P) { L = L->next; } return L; } element LocateL(zivotinja X, Lista *L) { while (L->next->value.sifra != X.sifra) { L = L->next; } return L; } bool InsertL(zivotinja X, element P, Lista *L) { element n = new Lista; n->value = X; n->next = P->next; P->next = n; return true; } void DeleteL(element P, Lista *L) { element del = P->next; P->next = del->next; delete del; } zivotinja RetrieveL(element P, Lista *L) { return P->next->value; } void DeleteAll(Lista *L){ element del = L->next; while (del != NULL) { L->next = del->next; delete del; del = L->next; } } void InitL(Lista *L) { L->next = NULL; }
Initial URL
Initial Description
U ovoj biblioteci su definirane funkcije za operacije nad listom, ali se, za razliku od prethodne biblioteke, ovdje koriste pokazivaÄi kojima se implementira tzv. vezana lista.
Initial Title
Biblioteka lista_pokazivaci.h
Initial Tags
Initial Language
C++