Tree: Preorder Traversal

  • + 0 comments

    In some languages like Kotlin it gives only a main fucntion which doesn't have a Node class. And there's no explanation how the single array, that the input is giving, is sorted... I spent hours trying to figure out what the tree from the input should look like and I was trying to write a function to create the tree with Node class... So then I switched to Java and saw that the node object is given...