Skip to content

giannileuani/CVSParentTree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

CVSParentTree

Demonstration for an interview question to put sample data into a hierarchical tree. The output tree in this case is XML output.

The request as given: The given string has pipe delimited nodes that represent family members in a family tree. Each node is a CSV with the values being "parent_id, node_id, node_name". Write a method that takes an input string and return a single result that represents the data as a hierarchy (root, children, siblings, etc).

Sample input: "null,0,grandpa|0,1,son|0,2,daugther|1,3,grandkid|1,4,grandkid|2,5,grandkid|5,6,greatgrandkid"

• Solve it in any language that you prefer • Display the hierarchical result any way you prefer (as long as the parent/child connections are clear)

Resulting sample output: null,0,grandpa 0,1,son 0,2,daugther 1,3,grandkid 1,4,grandkid 2,5,grandkid 5,6,greatgrandkid

About

Demonstration for an interview question to put sample data into a hierarchical tree. The output tree in this case is XML output.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages