I am working on an Inorder traversal for my binary search tree and I was wondering if there is any way to print out the content of my inorder traversal all in the same line.
So, for example, let's say I want it to come out as [ -1, 1, 3, 6, 8, 10, 14, 90] instead of how it actually does which if one by one. Just looking for ways to make the outcome look nicer. If you have any suggestions let me know. I have tried a few things but they don't seem to work.
def __in_order(self, root):
if root == None:
return
else:
self.__in_order(root.left_child)
print(str(root.value))
self.__in_order(root.right_child)