hi everyone
i have a problem in my project that i have made
pleaze help!!!!!
this project allows the user to read words and their meanings from file and store them in AVL tree and then print the tree inorder, postorder, and preorder then print the result to file in the form of dictionary A: .........
..........
B:..........
and so on, and then search for a word and its all meanings and if the word is not found add it to the tree then draw the tree in java graphics and finally ask the user if he want to delete any word

Recommended Answers

All 2 Replies

Pleaze i need this program soon if any one can help me

You haven't described what is your problem and what have you done so far. Don't expect us to read the entire code and see what works and what doesn't.
Also you are mixing everything up.

Forget about the gui.
Keep the node class and create an AVLTree class. The Tree is not a gui and has nothing to do with is. It is a tree. Meaning, test the functionality of the tree separately. The tree will do only the things you described. Have methods with arguments that search and delete and test all of them using System.out.print in a separate class. That class will have only the main method. Instantiate the tree in the main method and test it. Then create another gui class and this time instantiate the tree in there and use its methods.

That way if something doesn't work you will know what it is.

With your description and code no one is going to understand what is your problem. If your problem is for example "preorder" then all you have to do is fix the specific method and test it separately in the main method that I described. If it works, in the same main you will test the rest of the methods.
Then if all of them work you will call the Tree class in the new gui class that you will create and all other errors that you will be getting will be gui related. So you will not get confused as where to search for the error.


PS:
Use this:

left = null;
        right = null;
        father = null;

not this:

left = right = father = null;

with your way you are saying: left = right = father = null; that left, right, father are the same objects so one change made to the "left" will applied to the rest and mess up your logic

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.