System.out.println("The expected parent is 64. The actual parent is " + ((CustomTree) list).getParent("129"));
The hint show 129's parent should be 64 "Node 129's parent should be node 64."
I got 64 for 129's parent . Can not figure why it's incorrect.package com.codegym.task.task20.task2028;
import java.util.List;
public class Solution {
public static void main(String[] args) {
List<String> list = new CustomTree();
for (int i = 1; i < 140; i++) {
list.add(String.valueOf(i));
}
System.out.println("The list size is " + list.size());
System.out.println("The expected parent is 3. The actual parent is " + ((CustomTree) list).getParent("8"));
System.out.println("The expected parent is 7. The actual parent is " + ((CustomTree) list).getParent("15"));
System.out.println("The expected parent is 64. The actual parent is " + ((CustomTree) list).getParent("129"));
}
}