Revision: 60605
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at November 12, 2012 02:26 by izavrski2
Initial Code
struct List { podaci 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(podaci X, Lista *L) { while (L->next->value.sifra != X.sifra) { L = L->next; } return L; } bool InsertL(podaci 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; } podaci 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 standardne funkcije za operacije nad listom (FirstL, EndL, NextL, PreviousL, LocateL, InsertL, DeleteL, RetrieveL, DeleteAll i InitL). Te se funkcije pozivaju u glavnom programu po potrebi. Koriste pokazivaÄi kojima se implementira tzv. vezana lista.
Initial Title
Datoteka zaglavlja -lista_pokazivac.h
Initial Tags
list
Initial Language
C++