Pergunta

Wondering if there is a way to convert a binary tree into a grid such as this:

                    a
                  /   \
                 b     c
                / \   / \
               d   e f   g


                    or


                 d--b--e
                    |
                    a
                    |
                 f--c--g


                    to


                 d--b--e
                 |  |  |
                 y--a--x
                 |  |  |
                 f--c--g

An arbitrary sized binary tree. I'm not super familiar with binary tree properties so I am not sure if this would even be possible or if edge cases would prevent it from being possible.

Nenhuma solução correta

Licenciado em: CC-BY-SA com atribuição
Não afiliado a cs.stackexchange
scroll top