(6,2,2,6,2,5,10,9,9)
source link: https://math.stackexchange.com/questions/1534031/build-tree-by-pr%c3%bcfer-code-6-2-2-6-2-5-10-9-9/4318015
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Build Tree by Prüfer Code $(6,2,2,6,2,5,10,9,9)$
I have the Prufer Code (6,2,2,6,2,5,10,9,9)(6,2,2,6,2,5,10,9,9).
I want to build the corresponding tree.
My algorithm:
1) Tree = {}{}, code = (6,2,2,6,2,5,10,9,9)(6,2,2,6,2,5,10,9,9), count = (1,2,3,4,5,6,7,8,9,10,11)(1,2,3,4,5,6,7,8,9,10,11)
2) Tree ={(2,6)}{(2,6)}, code = (2,2,6,2,5,10,9,9)(2,2,6,2,5,10,9,9), count = (1,3,4,5,6,7,8,9,10,11)(1,3,4,5,6,7,8,9,10,11)
3) Tree ={(2,6),(2,3)}{(2,6),(2,3)}, code = (2,6,2,5,10,9,9)(2,6,2,5,10,9,9), count = (1,4,5,6,7,8,9,10,11)(1,4,5,6,7,8,9,10,11)
4) Tree ={(2,6),(2,3),(2,4)}{(2,6),(2,3),(2,4)}, code = (6,2,5,10,9,9)(6,2,5,10,9,9), count = (1,5,6,7,8,9,10,11)(1,5,6,7,8,9,10,11)
5) Tree ={(2,6),(2,3),(2,4),(5,6)}{(2,6),(2,3),(2,4),(5,6)}, code = (2,5,10,9,9)(2,5,10,9,9), count = (1,6,7,8,9,10,11)(1,6,7,8,9,10,11)
6) Tree ={(2,6),(2,3),(2,4),(5,6),(2,6)}{(2,6),(2,3),(2,4),(5,6),(2,6)}, code = (5,10,9,9)(5,10,9,9), count = (1,7,8,9,10,11)(1,7,8,9,10,11)
7) Tree ={(2,6),(2,3),(2,4),(5,6),(2,6),(5,7)}{(2,6),(2,3),(2,4),(5,6),(2,6),(5,7)}, code = (10,9,9)(10,9,9), count = (1,8,9,10,11)(1,8,9,10,11)
8) Tree ={(2,6),(2,3),(2,4),(5,6),(2,6),(5,7),(8,10)}{(2,6),(2,3),(2,4),(5,6),(2,6),(5,7),(8,10)}, code = (9,9)(9,9), count = (1,9,10,11)(1,9,10,11)
9) Tree ={(2,6),(2,3),(2,4),(5,6),(2,6),(5,7),(8,10),(9,10)}{(2,6),(2,3),(2,4),(5,6),(2,6),(5,7),(8,10),(9,10)}, code = (9)(9), count = (1,9,11)(1,9,11)
10) Tree ={(2,6),(2,3),(2,4),(5,6),(2,6),(5,7),(8,10),(9,10),(9,11)}{(2,6),(2,3),(2,4),(5,6),(2,6),(5,7),(8,10),(9,10),(9,11)}, code = ()(), count = (1,9)(1,9)
11) Tree = {(2,6),(2,3),(2,4),(5,6),(2,6),(5,7),(8,10),(9,10),(9,11),(1,9)}{(2,6),(2,3),(2,4),(5,6),(2,6),(5,7),(8,10),(9,10),(9,11),(1,9)}
Is my solution correct?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK