Mattie

Mattie

Jan 6th, 2011
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1.     public void countBladeren()
  2.     {
  3.         if (leftChild != null)
  4.         {
  5.             leftChild.countBladeren();
  6.             System.out.println("LEFT != NULL");
  7.         }
  8.         if (rightChild != null)
  9.         {
  10.             rightChild.countBladeren();
  11.             System.out.println("RIGHT != NULL");
  12.         }
  13.  
  14.         if (leftChild == null && rightChild == null)
  15.         {
  16.             aantalBladeren++;
  17.             System.out.println("RIGHT en LEFT == NULL");
  18.         }
  19.     }
  20.  
  21.     public int aantalBlad()
  22.     {
  23.         aantalBladeren = 0;
  24.         countBladeren();
  25.         return aantalBladeren;
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment