I'm currently working on a project where I have to make a binary search tree and I'm having a little problem implementing my getRootData method
I've already tried importing different things or trying to find an implemented method but I haven't found any luck.
public T getRootData() {
if (isEmpty())
throw new EmptyTreeException();
else
return root.getData();
}
Am I supposed to write a class for EmptyTreeExcpetion or is there something else I need to do.