I am currently studying a computer science course at university and one of the modules is teaching about Web Development using JSPs. This post is NOT concerning a coursework assignment although I...
Type: Posts; User: Java Bean
I am currently studying a computer science course at university and one of the modules is teaching about Web Development using JSPs. This post is NOT concerning a coursework assignment although I...
Solved it :)
Many thanks Norm for you patience and time. I have changed various values in the file to make different animals have the biggest value and it has returned the correct maximum every...
The way I am seeing it is that the returned value is used but that it is incorrect because inorderHelper() is obviously not right yet and I still need to solve that.
I took out the unnecessary args. I kind of made the situation worse trying to find a way to get it right and more variables crept in that were not needed.
The only time it could have returned 0...
I have edited the code in post #3 to match my latest testing on it. I am a bit rushed so will mention more about this on my return home.
Basically the max value is wrongly adjusted to a lower...
I will pick this up again tomorrow afternoon. I think I might just get it. I almost want to keep at it now, but I need to do other things for now.
To update, I have added a variable as an...
I have been trying to not use global variables which is the only other way I can see ... so far. I know I must be missing something that once I know it I will know forever, but I just cannot see it...
The method returns the root's attribute which is frustrating me. Also, to store it in a variable, the variable needs initialising and therefore it will just default to the initialised value when the...
Basically the x and y variables were just done for quickness when trying out my idea and checking what is going on. The names you suggest are essentially what they represent. I have tried to avoid...
Thanks for your time with this Norm. For now I have to rest and sleep so I will try again tomorrow.
I cannot work out the toString() method still. But my main issue here is how to get it to return...
I haven't done the toString() method in the Node class, mainly because I haven't worked out what you meant yet (I will probably realise in the morning after I have slept but I doing what I can while...
I have made a file which shows the output I am seeing (attached to this post).
I have also edited the code in post #3 which should be exactly the same as what I am using at the moment
It is in post #3
I have also edited it to have the file I am currently working from in the same thread.
Maybe I should have edited the code there also.
I didn't get my edit in quick enough :eek:
It compiless now. Sorry.
In the BinarySearchTree class I have put these methods which replace the largest() methods previously posted. (I have replaced formatting in my actual code to be submitted work with spaces between...
Sorry for the delay in responding. I had other classes today and there is work for them also :(
I am back to doing this again. I have put in several print statements in to see what is...
I am still stuck with this. Whilst I said I can see why my previous effort is failing, I still have not found a way to get this right.
I am not sure what you mean with the first suggestion. The...
I realised it was not checking all the nodes when I looked for an explanation for it returning the wrong value. My first effort to put it right so it searches all nodes caused it to just return the...
I found using a print statement very useful in helping me to get to the solution of another method that had been troubling me. I pretty much understand why it is not returning the correct value in...
I will create a file that exactly replicates the same issue. After that I will try something that has occurred to me that might work.
Basically my reason for this is that this is a public forum...
It reads the file fine. It is the method that the problem is with. I have made a dummy file and added it to the post. It will probably not have the same result because the data is different, but the...
Hello Norm
Sorry for the delay. I didn't want to put all my code for the whole assignment online so I took out the methods not relevant to this problem and made some slight changes. I have checked...
Hi everyone. I have pretty much done all of the coding for my assignment apart from one method.
The main aim of the assignment is to read in entries from a file and put them into a BST sorted...