def createTree(num_nodes):
 root = Node((num_nodes // 2))
 for i in range(num_nodes):
  if (i == (num_nodes // 2)):
   continue
  root = insert(i, root)
 return root

def createTree ( num_nodes ) : root = Node ( ( num_nodes // 2 ) ) for i in range ( num_nodes ) : if ( i == ( num_nodes // 2 ) ) : continue root = insert ( i , root ) return root
a function created to construct the tree from 0 to num_nodes the root will be the the middle number of num_nodes .