# Posted By

izavrski2 on 11/12/12

# Statistics

Viewed 554 times
Favorited by 0 user(s)

# Datoteka zaglavlja -lista_pokazivac.h

/ Published in: C++
Save to your folder(s)

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.

Copy this code and paste it in your HTML
`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;}`

## Comments

Subscribe to comments

You need to login to post a comment.