$this->phone = $phone; } public function id() { return $this->name; } public function get() { return $this->phone; } } class ContactList extends BinaryTree { } $list = new ContactList(); $list->insert(new Contact('Sue', '555-1234')); $list->insert(new Contact('John', '555-5678')); $list->insert(new Contact('Mary', '555-9012')); $list->insert(new Contact('Sally', '555-9876')); $list->insert(new Contact('Mark', '555-3456')); $list->insert(new Contact('Tom', '555-7890')); $list->insert(new Contact('Dick', '555-4567')); $list->insert(new Contact('Sally', '555-7654')); $list->insert(new Contact('Harry', '555-6789')); $list->insert(new Contact('Julie', '555-5432')); $list->insert(new Contact('Paul', '555-3210')); echo $list->locate('John', 'inorder') . "\n"; // 555-5678 echo $list->locate('Tom', 'preorder') . "\n"; // 555-7890 echo $list->locate('Mary', 'postorder') . "\n";