I have created 2 different data structures to hold the same data: (1) An array (works fine)
and (2) A Binary search tree. The tree seems to work fine on its own (worked fine
when I insert entries from the array built from the same list) but when I try to insert entries directly
from a file it falters, throwing a good ol' null pointer at me! I have tried to test the insert method
within the tree itself, however no test print statements seem to call. Below I have given the
error readout and the piece of code which fails. Please Help!!!
Error:
File Opened
Soren Kierkegaard was 42 years old. Born: 05 May 1813, died: 11 Nov 1855
Existentialist@29cc3436
Exception in thread "main" java.lang.NullPointerException
at ExistentialistTreeFromFile.newExistTree(ExistentialistTreeFromFile.java:23)
at ExistentialistTreeFromFile.<init>(ExistentialistTreeFromFile.java:10)
at ExistentialistTreeTester.main(ExistentialistTreeTester.java:11)
Java:
}