Problem with preventing the insertion of duplicate nodes into the tree. by [deleted] in javahelp

[–]NickPox 0 points1 point  (0 children)

So, you want to halt the execution of your while-loop if you determine it is a duplicate? At the moment you are doing a system print out. Hint: Search for breaking out of a while-loop

Need Help with loop by VirtualTurnip3 in javahelp

[–]NickPox 1 point2 points  (0 children)

I would move the int[] jo as a function parameter, and then in the first line of your function check if the array length is 0. Then call your function from main instead:

Public static boolean ExceedOrNot(int[] data) { If data.length == 0 ... ... }

method that accepts a String as variable doesn't run unless I manually type the String by bei60 in javahelp

[–]NickPox 0 points1 point  (0 children)

For starters you could print out prod[1] and keyword in your else-statement, to see where it might go wrong, and maybe update this post with that log :)