Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void dodajNto(const Tip& el, int n)
- {
- if (n<0 || n>brojEl) throw "n izvan opsega";
- if(brojEl==0 && n==0)
- {
- dodajIspred(el);
- brojEl++;
- return;
- }
- else if(n==0 && brojEl!=0)
- {
- pocetak();
- dodajIspred(el);
- brojEl++;
- return;
- }
- else if(n==brojEl)
- {
- Cvor* novi=new Cvor;
- novi->prVeza=Kraj;
- novi->element=el;
- novi->veza=nullptr;
- Kraj->veza=novi;
- Kraj=novi;
- brojEl++;
- return;
- }
- pocetak();
- for (int i(1); i< n; i++)
- sljedeci();
- dodajIza(el);
- brojEl++;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement