Language: C

#include <stdio.h>
#define MAX 100005
#define NIL -1

struct Node {int p,l,r; };

Node T[MAX];
int n,D[MAX];

void print(int u)
{
	int i,c;
	printf("node %d: parent = %d, depth = %d, ",u, T[u].p, D[u]);
	
	if(T[u].p == NIL) printf("root, ");
	else if(T[u].l == NIL) printf("leaf, ");
	else printf("internal node, ");
	
	printf("[");
	
	for(i = 0,c = T[u].l; c != NIL; i++,c = T[c].r)
	{
		if(i) printf(", ");
		printf("%d",c);
	}
	printf("]\n");
}

int rec (int u, int p)
{
	D[u] = p;
	if(T[u].r != NIL) rec(T[u].r,p);
	if(T[u].l != NIL) rec(T[u].l,p + 1);
}

int main()
{
	int i,j,d,v,c,l,r;
	scanf("%d",&n);
	for(i = 0; i < n; i++) T[i].p = T[i].l = T[i].r = NIL;
	
	for(i = 0; i < n; i++)
	{
		scanf("%d",&v); v = d;
		for(j = 0; j < d; j++);
		{
			scanf("%d",&c);
			if(j == 0) T[v].l = c;
			else T[l].r = c;
			l = c;
			T[c].p = v;
		}
	}
	for(i = 0; i < n; i++)
	{
		if(T[i].p == NIL) r = i;
	}
	
	rec(r,0);
	
	for(i = 0; i < n; i++) print(i);
	
	return 0;
}


Compiler output:
main.c:7:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
    7 | Node T[MAX];
      | ^~~~
      | struct 
main.c: In function 'print':
main.c:13:60: error: request for member 'p' in something not a structure or union
   13 |         printf("node %d: parent = %d, depth = %d, ",u, T[u].p, D[u]);
      |                                                            ^
main.c:15:16: error: request for member 'p' in something not a structure or union
   15 |         if(T[u].p == NIL) printf("root, ");
      |                ^
main.c:16:21: error: request for member 'l' in something not a structure or union
   16 |         else if(T[u].l == NIL) printf("leaf, ");
      |                     ^
main.c:21:27: error: request for member 'l' in something not a structure or union
   21 |         for(i = 0,c = T[u].l; c != NIL; i++,c = T[c].r)
      |                           ^
main.c:21:53: error: request for member 'r' in something not a structure or union
   21 |         for(i = 0,c = T[u].l; c != NIL; i++,c = T[c].r)
      |                                                     ^
main.c: In function 'rec':
main.c:32:16: error: request for member 'r' in something not a structure or union
   32 |         if(T[u].r != NIL) rec(T[u].r,p);
      |                ^
main.c:32:35: error: request for member 'r' in something not a structure or union
   32 |         if(T[u].r != NIL) rec(T[u].r,p);
      |                                   ^
main.c:33:16: error: request for member 'l' in something not a structure or union
   33 |         if(T[u].l != NIL) rec(T[u].l,p + 1);
      |                ^
main.c:33:35: error: request for member 'l' in something not a structure or union
   33 |         if(T[u].l != NIL) rec(T[u].l,p + 1);
      |                                   ^
main.c: In function 'main':
main.c:40:36: error: request for member 'p' in something not a structure or union
   40 |         for(i = 0; i < n; i++) T[i].p = T[i].l = T[i].r = NIL;
      |                                    ^
main.c:40:45: error: request for member 'l' in something not a structure or union
   40 |         for(i = 0; i < n; i++) T[i].p = T[i].l = T[i].r = NIL;
      |                                             ^
main.c:40:54: error: request for member 'r' in something not a structure or union
   40 |         for(i = 0; i < n; i++) T[i].p = T[i].l = T[i].r = NIL;
      |                                                      ^
main.c:48:40: error: request for member 'l' in something not a structure or union
   48 |                         if(j == 0) T[v].l = c;
      |                                        ^
main.c:49:34: error: request for member 'r' in something not a structure or union
   49 |                         else T[l].r = c;
      |                                  ^
main.c:51:29: error: request for member 'p' in something not a structure or union
   51 |                         T[c].p = v;
      |                             ^
main.c:56:24: error: request for member 'p' in something not a structure or union
   56 |                 if(T[i].p == NIL) r = i;
      |                        ^