static string Substract(string from, string value) { var bsd = new Bst <char>(); foreach (var ch in value) { bsd.AddUnique(ch); } var builder = new StringBuilder(); foreach (var ch in from) { if (!bsd.Contains(ch)) { builder.Append(ch); } } return(builder.ToString()); }
private static bool HasDublicates(int[] array) { if (array == null) { throw new ArgumentNullException(); } if (array.Length == 0) { return(false); } var bsd = new Bst <int>(); for (var i = 1; i < array.Length; i++) { if (!bsd.AddUnique(array[i])) { return(true); } } return(false); }