Amazon|Phone|USA|SDE2|Subtree of Another Tree
Anonymous User
354

I just failed Amazon phone interview. The interview asked me some questions realted to Subtree of Another Tree, which I wasn't able to answer them correctly.

  1. What is the time complexity of searching a value in hashmap? Which

I thought it's O(N) to search a value without a key. Is it using a hashset since it can search a value in O(1)

  1. Subtree of Another Tree
  1. How to implement/improve this solution if there are multiple subtrees (a list of subRoots) to compare?
  2. How to implement/improve this solution for multi-threading?
Comments (3)