Hello! I am trying to implement and visualize huffman compression algorithm. Does anyone knows an api for visualizing binnary trees;
Printable View
Hello! I am trying to implement and visualize huffman compression algorithm. Does anyone knows an api for visualizing binnary trees;
Visualizing a binary tree isn't that difficult: the root of the tree is at the top middle of the page/window/jpanel; the left sub-tree takes the left part of the page/window/whatever and the right sub-tree takes up the right part. The roots of the left/right sub-trees are drawn below the root of the tree. Apply this recursively and voila.
kind regards,
Jos
You could use a 3rd party library like JUNG, but in my opinion doing so would get you so bogged down with getting familiar with the API that it would probably be much faster taking JosAH's advice.