Answers for "python node"

2

how to make a python node

class Node:
  def __init__(self, value, link_node=None):
    self.value = value
    self.link_node = link_node
    
  def set_link_node(self, link_node):
    self.link_node = link_node
    
  def get_link_node(self):
    return self.link_node
  
  def get_value(self):
    return self.value
Posted by: Guest on May-08-2020
-1

python node

class Node:

    def __init__(self, data):

        self.left = None
        self.right = None
        self.data = data


    def PrintTree(self):
        print(self.data)

root = Node(10)

root.PrintTree()
Posted by: Guest on March-31-2020

Python Answers by Framework

Browse Popular Code Answers by Language