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

Method __str__

dynamic_programming/optimal_binary_search_tree.py:30–35  ·  view source on GitHub ↗

>>> str(Node(1, 2)) 'Node(key=1, freq=2)'

(self)

Source from the content-addressed store, hash-verified

28 self.freq = freq
29
30 def __str__(self):
31 """
32 >>> str(Node(1, 2))
33 'Node(key=1, freq=2)'
34 """
35 return f"Node(key={self.key}, freq={self.freq})"
36
37
38def print_binary_search_tree(root, key, i, j, parent, is_left):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected