Wednesday, January 5, 2011

Build a tree from a matrix

An n-ary tree is represented in a matrix form and A[i,j] = 1 if j is the ancestor of i, otherwise A[i,j] = 0. Given this construct the tree.

No comments:

Post a Comment