Skip to content

Commit

Permalink
phone screen update
Browse files Browse the repository at this point in the history
  • Loading branch information
Paramaguru Gnanaguru authored and Paramaguru Gnanaguru committed Oct 20, 2020
1 parent 1e4a45d commit 26ae79f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace LeetCode.Interviews
{
[TestClass]
// Date: 9/18/2018
public class AmazonPhoneScreening
public class PhoneScreening1
{
/*
At amazon products are organized in a hierarchy called browse nodes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,38 @@
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

/*
Interview
---------
Q: Find and return the position of node in cloned tree for the given node in original tree ?
Note: Only structure is cloned, need not be values.
You are given two parameters:
T1 = Node of the original tree
T2 = Cloned tree root
TreeNode FindPosition(TreeNode clone, TreeNode nodeOfOriginal) {
// Your code...
return nodePositionInClone;
}
Example:
T1
10
/ \
20 30
/ | \
40 50 60
/ \
70 80
T2 (Clone of T1)
Clone of Tree 1 - only the structure and need not be values
1
/ \
2 3
/ | \
4 5 6
/ \
7 8
*/
namespace LeetCode.Interviews
{
public class TreeNode
Expand All @@ -17,7 +49,7 @@ public TreeNode(int value)
}

[TestClass]
public class FaceBookPhoneScreening
public class PhoneScreening2
{
public TreeNode FindTreeNode(TreeNode clone, TreeNode nodePosition)
{
Expand Down

0 comments on commit 26ae79f

Please sign in to comment.