I want to print out into my sorted tree on which level this number was and that must be a recursion function.
Here is my code:
void printout(KNOTEN *start) {
if (start == NULL)
return;
printout(start->left);
printf("%d\n", start->number);
printout(start->right);
free(start);
}
Here is an example of the output:
My input Numbers 41, 18467, 6334 , 26500, 19169
Outprint is 41,6334,18467,19169,26500
What I want is:
41 Level 1 , 6334 level 3 , 18467 level 2 , 26500 level 3 , 19169 level 4
I would modify it to this: