For my project i need to convert Adjacency list into binary tree. i'm using java language. i can't figure out how to do it. Any one knows how to do it or any document to refer??
For my project i need to convert Adjacency list into binary tree. i'm using java language. i can't figure out how to do it. Any one knows how to do it or any document to refer??
If you know the adjacency list correspond to a binary tree then search for the root (only node with zero indegree). Later, perform a DFS (Depth First Search) starting at the root to create the tree. And, that is.
Try,