QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#864059#3445. Numbers On a TreeHuangHanShengCompile Error//Java171.5kb2025-01-20 09:45:022025-01-20 09:45:08

Details

Node.java:15: error: class BinaryTreeNode is public, should be declared in a file named BinaryTreeNode.java
public class BinaryTreeNode {
       ^
Node.java:22: error: constructor BinaryTreeNode in class BinaryTreeNode cannot be applied to given types;
        BinaryTreeNode root = new BinaryTreeNode(startLabel);
                              ^
  required: no arguments
  found:    long
  reason: actual and formal argument lists differ in length
Node.java:24: error: cannot find symbol
        root.right = constructBinaryTree(height - 1, startLabel - 1);
            ^
  symbol:   variable right
  location: variable root of type BinaryTreeNode
Node.java:25: error: cannot find symbol
        root.left = constructBinaryTree(height - 1, startLabel - 1 - leftSubtreeSize);
            ^
  symbol:   variable left
  location: variable root of type BinaryTreeNode
Node.java:34: error: cannot find symbol
                current = current.left;
                                 ^
  symbol:   variable left
  location: variable current of type BinaryTreeNode
Node.java:36: error: cannot find symbol
                current = current.right;
                                 ^
  symbol:   variable right
  location: variable current of type BinaryTreeNode
Node.java:43: error: cannot find symbol
        return current.label;
                      ^
  symbol:   variable label
  location: variable current of type BinaryTreeNode
7 errors