• 请不要在回答技术问题时复制粘贴 AI 生成的内容
fuchaofather
V2EX  ›  程序员

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

  •  
  •   fuchaofather · Oct 22, 2018 · 2134 views
    This topic created in 2766 days ago, the information mentioned may be changed or developed.

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

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

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

    5 replies    2018-10-23 15:06:58 +08:00
    KeatingSmith
        2
    KeatingSmith  
       Oct 22, 2018 via iPhone
    明白原理,努力写一个实现。
    Variazioni
        3
    Variazioni  
       Oct 22, 2018   ❤️ 1
    调一下控制台的字体啊。。。
    fuchaofather
        4
    fuchaofather  
    OP
       Oct 22, 2018 via Android
    @Variazioni 大胸弟你可真聪明,等宽字体。🤓🤓
    Variazioni
        5
    Variazioni  
       Oct 23, 2018
    @fuchaofather 换一种思路是不是很容易就解决了。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4459 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 10:00 · PVG 18:00 · LAX 03:00 · JFK 06:00
    ♥ Do have faith in what you're doing.