A Node represents an element of a binary tree, which contains: Attributes: data: The value stored in the node (int). left: Pointer to the left child node (Node or None). right: Pointer to the right child node (Node or None). Example: >>> node = Node(1, Node(2), Node(3)
| 12 | |
| 13 | @dataclass |
| 14 | class Node: |
| 15 | """ |
| 16 | A Node represents an element of a binary tree, which contains: |
| 17 | |
| 18 | Attributes: |
| 19 | data: The value stored in the node (int). |
| 20 | left: Pointer to the left child node (Node or None). |
| 21 | right: Pointer to the right child node (Node or None). |
| 22 | |
| 23 | Example: |
| 24 | >>> node = Node(1, Node(2), Node(3)) |
| 25 | >>> node.data |
| 26 | 1 |
| 27 | >>> node.left.data |
| 28 | 2 |
| 29 | >>> node.right.data |
| 30 | 3 |
| 31 | """ |
| 32 | |
| 33 | data: int |
| 34 | left: Node | None = None |
| 35 | right: Node | None = None |
| 36 | |
| 37 | |
| 38 | def make_symmetric_tree() -> Node: |
no outgoing calls
no test coverage detected