Advertisement
Kame3

SLL brisi_pomali_od

Feb 9th, 2021
641
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.36 KB | None | 0 0
  1. public SLL brisi_pomali_od(int iznos) {
  2.         // Vasiot kod tuka
  3.         SLLNode d1 = first;
  4.         SLLNode D2 = first;
  5.        
  6.         while (d1 !=null){
  7.             if (d1.plata < iznos){
  8.                 if (d1 == first)
  9.                     d1 = d2 = first = first.succ;
  10.                 else{
  11.                     d2.succ = d1.succ;
  12.                     d1 = d1.succ;
  13.                 }
  14.             } else {
  15.                 if (d1!=first) d2 = d1;
  16.                 d1 = d2.succ;
  17.             }
  18.         }
  19.         return this;
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement