MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / is_full

Method is_full

data_structures/binary_tree/basic_binary_tree.py:93–104  ·  view source on GitHub ↗

Returns True if the tree is full >>> BinaryTree(Node(1)).is_full() True >>> BinaryTree.small_tree().is_full() True >>> BinaryTree.medium_tree().is_full() False

(self)

Source from the content-addressed store, hash-verified

91 return 1 + max(self._depth(node.left), self._depth(node.right))
92
93 def is_full(self) -> bool:
94 """
95 Returns True if the tree is full
96
97 >>> BinaryTree(Node(1)).is_full()
98 True
99 >>> BinaryTree.small_tree().is_full()
100 True
101 >>> BinaryTree.medium_tree().is_full()
102 False
103 """
104 return self.root.is_full()
105
106
107if __name__ == "__main__":

Callers

nothing calls this directly

Calls 1

is_fullMethod · 0.45

Tested by

no test coverage detected