I need to draw some singly and double linked lists for a CS paper and I don't know what package should I use. As far as I've searched over the Internet I can't seem to find a good one. Maybe TiKZ/PGF? If so, I would need a little example.
|
Here's a possible solution using
|
|||||||
|
|
Users only need to modify the following values and keep the names remain unchanged.
|
||||
|
|
|
Graphviz is an easy-to-use tool that lets one specify graphs without worrying too much about how they appear. The dot language is easy. Here is a singly-linked list:
Making this bidirectional is almost as easy. You could specify that each node is bidirectional. Even easier, specify that all nodes are bidirectional:
There are a number of avenues to import your .dot file as a graphic in your LaTeX document. If you are using pdflatex, pipe the output of the dot command (specifying output format=ps) that comes with graphviz to ps2pdf to generate a .pdf file. You can \includegraphics this .pdf into your document. Don't like the mixed up fonts that result? Use dot2tex (http://www.fauskes.net/code/dot2tex/) to convert the .dot file to latex as a series of pstricks commands. |
|||||||||||
|


