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.
what is wrong with below code? every node is added at right location but last 2 (leaf) nodes of 0th test case are not visible
public class Solution {
public static Boolean check(int nodev,List u){
for(int x:u){
if (nodev==x) return true;
}
return false;
}
public static int index(int value,List t){
for(int i=0;i ele=new ArrayList<>();
List col=new ArrayList<>();
List u=new ArrayList<>();
List v=new ArrayList<>();
Java Visitor Pattern
You are viewing a single comment's thread. Return to all comments →
what is wrong with below code? every node is added at right location but last 2 (leaf) nodes of 0th test case are not visible
public class Solution { public static Boolean check(int nodev,List u){ for(int x:u){ if (nodev==x) return true; } return false; } public static int index(int value,List t){ for(int i=0;i ele=new ArrayList<>(); List col=new ArrayList<>(); List u=new ArrayList<>(); List v=new ArrayList<>();