Timeline for Java: Given a list of edges, build a tree and return the root
Current License: CC BY-SA 3.0
3 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 2, 2017 at 20:14 | vote | accept | Sid | ||
| May 2, 2017 at 19:43 | comment | added | Sid | Wow! Thanks a lot for such in depth feedback. I really appreciate it. I had talked to the interviewer and told him that the hashmap that is returned from the buildList method in my code is the tree where each node represents the parent and it's adjacency list contains the children. The main goal was to return the root, rather than traverse the tree. I could probably make another method to traverse the tree. I do have an issue to come up with good names for methods and variables, and I will surely keep in mind the tips that you gave. | |
| May 2, 2017 at 9:04 | history | answered | Imus | CC BY-SA 3.0 |