Google

  www.google.com
  www.google.com

Interview Question

Software Engineer Interview New York, NY

The question was on n-ary tree data stream. Not unexpected

  , but there was a misunderstanding between myself and the interviewer. The question is to find the head of the tree given a data stream of key value pairs.
Answer

Interview Answer

1 Answer

1

think of the tree as an acyclic graph, use dfs to obtain topological order, head of the tree is the first node in topological order

Cathy Liu on Jun 8, 2014

Add Answers or Comments

To comment on this Question, Sign In with Facebook or Sign Up