Insterting avl tree

51 Views Asked by At

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?

0

There are 0 best solutions below