Пример #1
0
 //recursively remove one random string from words list and tree, then test alphabetic order
 static void RecursiveTest(BST tree, List<string> words)
 {
     if (words.Count > 0) {
         //test alphabetic order first, throws error if not alphabetized
         TestAlphabeticOrder(tree);
         //remove a random element from the tree and word list
         int random = new Random().Next(0, words.Count);
         string remove = words[random];
         words.RemoveAt(random);
         tree.Delete(remove);
         RecursiveTest(tree, words);
     }
 }