| 1 | <?php |
||
| 21 | class TrieNode implements Countable { |
||
| 22 | public $char; |
||
| 23 | public $isWord; |
||
| 24 | public $children; |
||
| 25 | public $parent; |
||
| 26 | |||
| 27 | public function __construct($char = '', &$parent = null, $isWord = false) { |
||
| 33 | |||
| 34 | public function hasChildren() : bool { |
||
| 37 | |||
| 38 | public function isLeaf() : bool { |
||
| 41 | |||
| 42 | public function isRoot() : bool { |
||
| 45 | |||
| 46 | |||
| 47 | public function count() { |
||
| 50 | } |