0

I implemented and AVL tree using C++, at the moment I print the AVL tree to the console but I need to represent the tree using GUI as part of an application the user can use to interact with the tree. what libraries etc. should I look into in order to achieve this?

Note: I'm using OS X

Samantha Catania
  • 5,116
  • 5
  • 39
  • 69

3 Answers3

0

graphviz is a graph visualization toolkit. Writing graphviz files is really simple and using one of the back-ends to spew out an image, too. You can then display those images with whatever toolkit you like.

pmr
  • 58,701
  • 10
  • 113
  • 156
0

graphviz could do the work.

And here is the document.

xiaoyi
  • 6,641
  • 1
  • 34
  • 51
0

The point here seems to be that some kind of user interaction is expected.

What kind of operations shall the user be able to invoke? Moving nodes, inserting, deleting?

You can go for the graphviz approach, but if you want to have user interaction, then for graphviz you should go for html output. That way you can e.g. associate nodes with clickable links where you can put some operation logic behind.

If that is not sufficient, then you will need to go for a generic GUI framework, and see what kind of libraries are available.

In case of C++, Qt is one thing to look into. There is something called a treeview that might fit to your problem (see e.g. here: http://doc.qt.digia.com/qt/qtreeview.html).

However, be prepared that it will take you some time to get into Qt.

Zane
  • 926
  • 8
  • 21