Language: C

#include <stdio.h>
#define MAX 10005
#define NIL -1
struct Node {
    int p;
    int l;
    int r;
};

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

void 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(void) {
    int i, j, d, v, c,l, r, u;
    scanf("%d", &n);
    for (i = 0 ; i < n ; i ++) T[i].p = T[i].r = T[i].l = NIL;

    for (i = 0 ; i < n ; i ++) {
        scanf("%d %d",&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 (u = 0 ; u < n ; u ++) {

        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 ; c = T[c].r, i ++ ) {
            if (i) printf(", ");
            printf("%d",c);
        }

        printf("]\n");
    } 
    return 0;
}

Compiler output:
main.c:10:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   10 | Node T[MAX];
      | ^~~~
      | struct 
main.c: In function 'rec':
main.c:15:13: error: request for member 'r' in something not a structure or union
   15 |     if (T[u].r != NIL) rec(T[u].r, p);
      |             ^
main.c:15:32: error: request for member 'r' in something not a structure or union
   15 |     if (T[u].r != NIL) rec(T[u].r, p);
      |                                ^
main.c:16:13: error: request for member 'l' in something not a structure or union
   16 |     if (T[u].l != NIL) rec(T[u].l, p+1);
      |             ^
main.c:16:32: error: request for member 'l' in something not a structure or union
   16 |     if (T[u].l != NIL) rec(T[u].l, p+1);
      |                                ^
main.c: In function 'main':
main.c:22:36: error: request for member 'p' in something not a structure or union
   22 |     for (i = 0 ; i < n ; i ++) T[i].p = T[i].r = T[i].l = NIL;
      |                                    ^
main.c:22:45: error: request for member 'r' in something not a structure or union
   22 |     for (i = 0 ; i < n ; i ++) T[i].p = T[i].r = T[i].l = NIL;
      |                                             ^
main.c:22:54: error: request for member 'l' in something not a structure or union
   22 |     for (i = 0 ; i < n ; i ++) T[i].p = T[i].r = T[i].l = NIL;
      |                                                      ^
main.c:28:30: error: request for member 'l' in something not a structure or union
   28 |             if (j == 0 ) T[v].l = c;
      |                              ^
main.c:29:22: error: request for member 'r' in something not a structure or union
   29 |             else T[l].r = c;
      |                      ^
main.c:31:17: error: request for member 'p' in something not a structure or union
   31 |             T[c].p = v;
      |                 ^
main.c:36:17: error: request for member 'p' in something not a structure or union
   36 |         if (T[i].p == NIL ) r = i;
      |                 ^
main.c:42:61: error: request for member 'p' in something not a structure or union
   42 |         printf("node %d: parent = %d, depth = %d, ", u, T[u].p, D[u]);
      |                                                             ^
main.c:44:18: error: request for member 'p' in something not a structure or union
   44 |         if ( T[u].p == NIL ) printf("root, ");
      |                  ^
main.c:45:22: error: request for member 'l' in something not a structure or union
   45 |         else if (T[u].l == NIL ) printf("leaf, ");
      |                      ^
main.c:49:31: error: request for member 'l' in something not a structure or union
   49 |         for ( i = 0 , c = T[u].l; c != NIL ; c = T[c].r, i ++ ) {
      |                               ^
main.c:49:54: error: request for member 'r' in something not a structure or union
   49 |         for ( i = 0 , c = T[u].l; c != NIL ; c = T[c].r, i ++ ) {
      |                                                      ^