public IEnumerable <int> TestReverseTraverse(List <int> items) { IterativeBinarySearchTree <int> tree = new IterativeBinarySearchTree <int>(items); List <int> result = new List <int>(); foreach (var item in tree.GetReversedEnumerator()) { result.Add(item); } return(result); }
public IEnumerable <int> CreateTreeFromCollectionWithComparerTest(List <int> items, IComparer <int> comparer) { IterativeBinarySearchTree <int> tree = new IterativeBinarySearchTree <int>(items, comparer); List <int> result = new List <int>(); foreach (var data in tree) { result.Add(data); } return(result); }
public IEnumerable <Student> CreateTreeFromCollectionTest(List <Student> items) { IterativeBinarySearchTree <Student> tree = new IterativeBinarySearchTree <Student>(items); List <Student> result = new List <Student>(); foreach (var data in tree) { result.Add(data); } return(result); }
public IEnumerable <int> AddTest(List <int> items, int item) { IterativeBinarySearchTree <int> tree = new IterativeBinarySearchTree <int>(items); tree.Add(item); List <int> result = new List <int>(); foreach (var data in tree) { result.Add(data); } return(result); }
public int TestSearch(List <int> items, int value) { IterativeBinarySearchTree <int> tree = new IterativeBinarySearchTree <int>(items); return(tree.Search(value).Data); }
public bool TestRemove(List <int> items, int value) { IterativeBinarySearchTree <int> tree = new IterativeBinarySearchTree <int>(items); return(tree.Remove(value)); }
public int TestGetMin(List <int> items, IComparer <int> comparator) { IterativeBinarySearchTree <int> tree = new IterativeBinarySearchTree <int>(items, comparator); return(tree.GetMin(tree.Root).Data); }
public Student TestGetLeft(List <Student> items, IComparer <Student> comparator) { IterativeBinarySearchTree <Student> tree = new IterativeBinarySearchTree <Student>(items, comparator); return(tree.GetLeft().Data); }
public string TestSearch(List <string> items, string value) { IterativeBinarySearchTree <string> tree = new IterativeBinarySearchTree <string>(items); return(tree.Search(value).Data); }
public bool TestRemove(List <string> items, string value) { IterativeBinarySearchTree <string> tree = new IterativeBinarySearchTree <string>(items); return(tree.Remove(value)); }
public string TestGetMin(List <string> items, IComparer <string> comparator) { IterativeBinarySearchTree <string> tree = new IterativeBinarySearchTree <string>(items, comparator); return(tree.GetMin(tree.Root).Data); }