java - binary tree deletion saying null pointer -


So far, I have added nodes to my binary tree which you can choose which parents want you to The hair node is additive but the problem is Whrnever I remove a node removes it and sometimes it says zero pointer exception and when I show my nodes it still there is this my dlatitan method:

 < Code> Public Zero deletion (node ​​node) {if (node! = Null) {if (node.value.equals (nodeToDelete)) {node = null; } Delete (node. Left); Delete (node.right); }}}   

I already define my node, add my method, and nododillet is a string and all.tnx already exists

Sometimes this is called zero notifier exception . I think your NPE was thrown when your node was not worth the value.

You need to review your code, how did you define your value ?

  if (node.value.equals (nodododelite)) {   

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -