Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Binary tree creation using python

class Node:
    def __init__(self, k):
        self.left = None
        self.right = None
        self.key = k


# Driver Code

root = Node(10)
root.left = Node(20)
root.right = Node(30)
root.left.right = Node(40)

# if root == None then binary tree is empty
Source by github.com #
 
PREVIOUS NEXT
Tagged: #Binary #tree #creation #python
ADD COMMENT
Topic
Name
8+4 =