Esempio n. 1
0
 public function test_that_clone_includes_linked_nodes()
 {
     $tree = new RedBlackSearchTree(new ComparableComparator());
     foreach ($this->getWeekDays() as $value => $key) {
         $tree->set($key, $value);
     }
     $copy = clone $tree;
     while (!$tree->isEmpty()) {
         $tree->removeMin();
     }
     $this->assertCount(7, $copy);
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function isEmpty() : bool
 {
     return $this->tree->isEmpty();
 }