public List <int> RepeatedValueList() { var list = new List <int>(); foreach (var value in Tree1.PreOrder()) { HashTable.Add(value.ToString(), value.ToString()); } foreach (var value in Tree2.PreOrder()) { if (HashTable.Contains(value.ToString())) { list.Add(value); } } return(list); }