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.
While I initially tried Node(value) as well, technically speaking the problem does implicitely document that Node() is the expected constructor.
From the problem definition,
/* Node is defined as :
class Node
int data;
Node left;
Node right;
*/
In Java, a class definition lacking a constructor definition automatically takes on the Default Constructor. Since there is no constructor defined here, we can assume the Default Constructor will be used.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Binary Search Tree : Insertion
You are viewing a single comment's thread. Return to all comments →
While I initially tried Node(value) as well, technically speaking the problem does implicitely document that Node() is the expected constructor.
From the problem definition,
In Java, a class definition lacking a constructor definition automatically takes on the Default Constructor. Since there is no constructor defined here, we can assume the Default Constructor will be used.