Driver Code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT ind = [ 0 ] NEW_LINE k = 3 NEW_LINE n = 10 NEW_LINE preorder = [ 1 , 2 , 5 , 6 , 7 , 3 , 8 , 9 , 10 , 4 ] NEW_LINE root = BuildKaryTree ( preorder , n , k , ind ) NEW_LINE print ( " Postorder ▁ traversal ▁ of ▁ constructed " , " full ▁ k - ary ▁ tree ▁ is : ▁ " ) NEW_LINE postord ( root , k ) NEW_LINE DEDENT