We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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...
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Tree: Preorder Traversal
You are viewing a single comment's thread. Return to all 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...