samedi 17 décembre 2016

Insterting avl tree

i want to insert a tree from a randomized array. here is my code :

      int[] startValues=new int [100];
      for(int i=0;i<startValues.length;i++){
      startValues[i]=rnd.nextInt(10);
      tree.insert(startValues[i]);

and then i see this warning:

 Exception in thread "main" java.lang.NullPointerException
 at myproject.AVLTree.singleWithLeftChild(AVLTree.java:77)
 at myproject.AVLTree.insert(AVLTree.java:47)
 at project.Test.main(Test.java:25)

how can i fix this problem?




Aucun commentaire:

Enregistrer un commentaire