A way to convert a binary tree into a grid
Вопрос
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.
Нет правильного решения
Не связан с cs.stackexchange