Find sum at level K

sir i cant understand how the input is being given
ca u please explain it

The input in this question is taken as a generic tree .
It takes the data of the node and the number of children it has .

class node{ //Generic_Tree node structure
int data ;
int noofchildren;
node* childArr;
node(int d,int n)
{ data = d;
noofchildren = n;
childArr = new node
[n]; //This creates an array of Node* pointers dynamically
}
};

Ask for the data and no of children in BuildTree()
If no of children = 0 ; then that node is leave node
take for loop for input data recursively for each child node
for eg. in this case
data of root node = 1 , having two children
2 node also has two children

Hey Rahul, as you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “Ask Doubt” section, when your doubt is resolved.