Can someone share their code (C++,JAVA) to read input from STDIN for tree based questions where input format is like. Thanks In advance.