Projects, portfolio, and personal work of Joe Pelz

Binary Tree Builder

To tree or not to tree

At one point in my second semester, three of my classes almost simultaneously began talking about binary trees. I had to draw and traverse a few of them by hand which was a very clear, simple, timeconsuming process so I tinkered with writing a program to do it for me.

I already had a lot of the groundwork from having built a circuit display, I just created a new "gate" type to display the numbers and had the computer handle the connecting and positioning aspects.

There are two things the program can do. When you type in the top left input box, your numbers are inserted into the tree. When you press the rebalance button at the bottom, the tree is rearranged to be balanced, and help maintain that O(log n) search efficiency.

Download the jar file here