How do you create this tree data structure one item at a time?

前端 未结 0 1810
星月不相逢
星月不相逢 2021-01-01 15:18

Here is the way this data structure / algorithm should work (each line is 1 step):

 1. []
 2. [1]
 3. [1, 2]
 4. [1, 2, 3]
 5. [[1, 2, 3], [4]]
 6. [[1, 2, 3]         


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