I am able to draw ovals wherever I want to represent the nodes using mouseClicked method and then join them using mouseReleased method and a JButton which enables me to select two ovals between which I want to draw a line. After this I have to do non recursive preorder,postorder and inorder traversals by highlighting the nodes. I know how to perform them and print the output to the console if I have a created a Binary tree without the Swing functionality. The swing functionality is just creating an image and not storing any tree for me. How do I perform the traversals using the image I have drawn of the tree?
Asked
Active
Viewed 234 times
1
-
Possible duplicate of [this](http://stackoverflow.com/q/10126695/230513) or [this](http://stackoverflow.com/q/15697697/230513). – trashgod Nov 14 '15 at 17:28
-
1@Andrew Thompson Sorry for forgetting to post the actual question. I have added the question now. – Unknown94 Nov 14 '15 at 17:33