开发者

Conversion of tree to graph data structure in java [closed]

It's difficult to tell what is being asked here. This question is ambiguous,开发者_开发知识库 vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

Is it possible to convert a graph data structure to a tree data structure in java? If possible can some one provide me the source?


All trees are valid graphs. So this should work

Object ConvertTreeToGraph( TreeData t )
{
   return t;
}


Yes, it is possible, just because a tree is a special graph. But as we have several datastructures to model trees and several datastructures for graphs it's not possible to give "one code to convert them all".

Further Reading

  • Tree Structures
  • Graph representations
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜