Revision: 60568
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at November 11, 2012 21:26 by Quake6
Initial Code
int LocateL(int n,t*list_head) { for(int i=0; i<list_head->kursor; i++) { if(n==list_head->jedna_zivotinja[i]->sifra)return i; } return list_head->kursor; } void InsertL(z*novi, int k, t*list_head) { if(k>EndL(list_head)) { } else { for (int i = EndL(list_head); i > k; i--) { list_head->jedna_zivotinja[i] = list_head->jedna_zivotinja[i-1]; } list_head->jedna_zivotinja[k] = novi; list_head->kursor = list_head->kursor + 1; } } struct z { int sifra,dan,mjesec,godina; char naziv[60]; char vrsta[60]; float cijena; }; struct t { z*jedna_zivotinja[1000]; int kursor; }; int DeleteL(int k, t*list_head) { k-=1; if(k>EndL(list_head)){} else { for(int i=k; i<EndL(list_head); i++) { list_head->jedna_zivotinja[i]=list_head->jedna_zivotinja[i+1]; list_head->kursor=list_head->kursor-1; return 0; } } } void DeleteAll(t*list_head) { list_head->kursor=0; } int NumberL(t*list_head) { int k=list_head->kursor; return k; } z*RetrieveL(int k,t*list_head) { return list_head->jedna_zivotinja[k-1]; } int FirstL(t*list_head) { return 0; } int EndL(t*list_head) { return list_head->kursor; } int NextL(int k,t*list_head) { return k+1; } int PreviousL(int k,t*list_head) { return k-1; } t*InitL(t*list_head) { t*novi=new t; novi->kursor=0; return novi; }
Initial URL
Strukture podataka evidencija zivotinja lista polja
Initial Description
Evidencija životinja pomoću lista polja
Initial Title
Evidencija životinja, lista polja - Zadatak_1, Strukture podataka
Initial Tags
Initial Language
C++