internal List <KeyValuePair <TKey, TValue> > GetAllData() { List <KeyValuePair <TKey, TValue> > ret = new List <KeyValuePair <TKey, TValue> >(); ret.Add(new KeyValuePair <TKey, TValue>(key, value)); if (right != null) { ret.AddRange(right.GetAllData()); } if (left != null) { ret.AddRange(left.GetAllData()); } return(ret); }