My Node class only has .left and .right, I cannot have a root variable. In this case, how can I get the root of the binary tree?
private int data; private Node rightChild; private Node leftChild; https://stackoverflow.com/questions/67428796/get-root-in-binary-tree-without-root-variable May 07, 2021 at 11:55AM
没有评论:
发表评论