Python. Fail to build tree base on the result of depth first search(with height of each node given). Not sure what's the problem when backtracking

后端 未结 0 1542
旧时难觅i
旧时难觅i 2021-01-13 10:34

The data input is a list with the hierarchy.

[node0 : 0(height), node1: 1 , node2: 2, node3:2, node4:1, node5: 2]

The tree I want then would

相关标签:
回答
  • 消灭零回复
提交回复
热议问题