可视化 c++数据结构
我正在寻找一个程序来帮助我调试 C++ 中的树。我的树有数千个节点,我想查看树的形成情况并查看问题节点和分支。操作系统并不重要。有人知道可以做到这一点的程序吗?
I am looking for a program to help me debug a tree in c++. My tree has thousands of nodes and I want to view the tree as it forms and view problem nodes and branches. Operating system doesn't matter. Anyone know of a program that can do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
不知道你在哪个平台,但是 DDD 对此非常好,尽管可以更不用说它在大型场景中的表现了。
Don't know what platform you are at, but DDD is pretty good with this, though can't say anything about its performance on huge sets.
我知道的唯一实用的方法就是自己编写!一个好的设计解决方案是实现访问者设计模式。然后你可以有不同的访问者,例如:
然后,您可以通过在关键点调用适当的访问者来“调试”。
我的2c
The only practical way I know is to write your own ! A good design solution is to implement a visitor design pattern. Then you can have different visitor like :
You can then "debug" by calling the appropriate visitor at key points.
my2c
您是否考虑过Dot?
Have you considered Dot?
我编写了一个名为 DSViz 的库,用于完成这项工作。您可以在这里找到它: https://github.com/sunxfancy/DSViz
您需要编写一个只需几行代码即可使用 API 生成 graphviz 文件,以便您可以使用附加工具绘制图形。
I have written a library called DSViz which is used to do this job. You can find it here: https://github.com/sunxfancy/DSViz
You need to write a few lines of code to use the API to generate a graphviz file so that you can draw the figure using addition tools.