哪位大佬有图形化二叉树的代码? 最好 Java 实现

2018-10-22 18:37:13 +08:00
 fuchaofather

找了些 blog, stackoverflow, github, 大部分都不怎么理想, 尤其对于不平衡树的打印. 类似这种:

                                           32                                               
                    ┌───────────────────────┴───────────────────────┐                       
                   24                                              47                       
        ┌───────────┴───────────┐                       ┌───────────┴───────────┐           
        3                      31                      41                      95           
        └─────┐                                                           ┌─────┘           
             13                                                          85                 
                                                                       ┌──┘                 
                                                                      67     

真是奇怪, 控制台看起来是乱的, 粘到 v2 里有好了

1580 次点击
所在节点    程序员
5 条回复
KeatingSmith
2018-10-22 18:48:16 +08:00
KeatingSmith
2018-10-22 18:49:09 +08:00
明白原理,努力写一个实现。
Variazioni
2018-10-22 21:12:11 +08:00
调一下控制台的字体啊。。。
fuchaofather
2018-10-22 21:48:08 +08:00
@Variazioni 大胸弟你可真聪明,等宽字体。🤓🤓
Variazioni
2018-10-23 15:06:58 +08:00
@fuchaofather 换一种思路是不是很容易就解决了。。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/499962

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX