If we are given a binary tree (with the root node), we can build a tree map without generating extra edges by using this helper method: it is an undirected graph with no weight/weight value of 1 the method of drawing is done using Depth First Search – DFS Map<TreeNode, List<TreeNode>> graph = new HashMap<>();… Read more »