Please help me in removing Run Error
Trees--Find sum at level k
@minal.251298,
Corrected code https://ide.codingblocks.com/s/225074
Don’t create 2 different objects of a scanner class. Instead just pass the scanner object from main method to your constructor.
Because in that case, one of the inputs is taken as \n by the compiler. To avoid that don’t create 2 different objects of the scanner class.
Or you can just take all the inputs in the generic tree class and make the scanner object global in that class.