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

Class Node

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

Binary Search Tree Node

Source from the content-addressed store, hash-verified

21
22
23class Node:
24 """Binary Search Tree Node"""
25
26 def __init__(self, key, freq):
27 self.key = key
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 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected