Results 1 to 3 of 3
  1. #1
    mike_ledis is offline Member
    Join Date
    Mar 2010
    Posts
    24
    Rep Power
    0

    Default Visuallizing Trees

    Hello! I am trying to implement and visualize huffman compression algorithm. Does anyone knows an api for visualizing binnary trees;

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,000
    Blog Entries
    7
    Rep Power
    20

    Default Re: Visuallizing 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
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    6

    Default Re: Visuallizing Trees

    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.

Similar Threads

  1. HELP!! Binary trees
    By Get_tanked in forum New To Java
    Replies: 4
    Last Post: 03-24-2011, 06:09 PM
  2. Red/Black Trees
    By f1gh in forum New To Java
    Replies: 4
    Last Post: 12-12-2010, 02:30 AM
  3. Binary trees
    By girgishf in forum Advanced Java
    Replies: 15
    Last Post: 11-20-2010, 04:29 PM
  4. Splay Trees
    By Growler in forum New To Java
    Replies: 0
    Last Post: 11-02-2010, 02:10 PM
  5. Need help with Trees...(8-puzzle)
    By ventrue in forum New To Java
    Replies: 2
    Last Post: 03-23-2009, 11:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •