Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1.   public int L(Node korzen,string wartosc)
  2.             {
  3.                 Node obecny = korzen;
  4.  
  5.                 int licznik = 0;
  6.  
  7.                     if (obecny == null)
  8.                     {
  9.                         Console.WriteLine("BRAK WYNIKÓW");
  10.                     }
  11.                     if (cmp1(wartosc, obecny.wartosc) == 0 && obecny.lewy!=null && obecny.prawy!=null )
  12.                     {
  13.                     licznik++;
  14.                         return L(obecny.lewy,wartosc)+ L(obecny.prawy, wartosc)+1;
  15.                     }
  16.                     else if (cmp1(wartosc, obecny.wartosc) < 0)
  17.                     {
  18.                         obecny = obecny.lewy;
  19.                     }
  20.                     else if (cmp1(wartosc, obecny.wartosc) > 0)
  21.                     {
  22.                         obecny = obecny.prawy;
  23.                     }
  24.                    
  25.                
  26.                 return licznik;
  27.  
  28.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement