Language: C

#include<stdio.h>
 
 
struct intree{
  int key;
  int id;  
  int k;
  int depth;
  int dom;  
  int child[15];
   
};
 
intree list[];
 
int main(void){
  int n,i,j,k;
  
   
  scanf("%d",&n);
  for(i=0;i<n;i++){
    list[i].key=-1;
    list[i].depth=0;
  }  
   
  for(i=0;i<n;i++){
    scanf("%d",&k);
    list[k].id=k;
    list[k] .dom=i;  
    scanf("%d",&list[k].k);
     
    if(list[k].k!=0){
      for(j=0;j<list[k].k;j++){
    scanf("%d",&list[k].child[j]);
    list[list[k].child[j]].key=list[k].id;    
    list[list[k].child[j]].depth=1;
      }
    }
     
  
  }
   
  for(i=0;i<n;i++){
    for(j=0;j<list[list[i].dom].k;j++){  
      list[list[list[i].dom].child[j]].depth+=list[list[i].dom].depth;
     
  }
}
 
 
   
   
    for(i=0;i<n;i++){
    printf("node %d: ",list[i].id);
    printf("parent = %d, ",list[i].key);
    printf("depth = %d, ",list[i].depth);  
    if(list[i].key==-1) printf("root, ");
    else if(list[i].k==0) printf ("leaf, ");
    else printf("internal node, ");
    printf("[");       
    for(j=0;j<list[i].k;j++){
      if(j==list[i].k-1){
    printf("%d",list[i].child[j]);
    break;}
      printf("%d, ",list[i].child[j]);
    }
    printf("]\n");
    }
 
/*    for(i=0;i<n;i++){
      printf("%d\n",list[i].dom);
      }*/
  return 0;
}

Compiler output:
main.c:14:1: error: unknown type name 'intree'; use 'struct' keyword to refer to the type
   14 | intree list[];
      | ^~~~~~
      | struct 
main.c: In function 'main':
main.c:22:12: error: request for member 'key' in something not a structure or union
   22 |     list[i].key=-1;
      |            ^
main.c:23:12: error: request for member 'depth' in something not a structure or union
   23 |     list[i].depth=0;
      |            ^
main.c:28:12: error: request for member 'id' in something not a structure or union
   28 |     list[k].id=k;
      |            ^
main.c:29:13: error: request for member 'dom' in something not a structure or union
   29 |     list[k] .dom=i;
      |             ^
main.c:30:24: error: request for member 'k' in something not a structure or union
   30 |     scanf("%d",&list[k].k);
      |                        ^
main.c:32:15: error: request for member 'k' in something not a structure or union
   32 |     if(list[k].k!=0){
      |               ^
main.c:33:24: error: request for member 'k' in something not a structure or union
   33 |       for(j=0;j<list[k].k;j++){
      |                        ^
main.c:34:24: error: request for member 'child' in something not a structure or union
   34 |     scanf("%d",&list[k].child[j]);
      |                        ^
main.c:35:17: error: request for member 'child' in something not a structure or union
   35 |     list[list[k].child[j]].key=list[k].id;
      |                 ^
main.c:35:39: error: request for member 'id' in something not a structure or union
   35 |     list[list[k].child[j]].key=list[k].id;
      |                                       ^
main.c:36:17: error: request for member 'child' in something not a structure or union
   36 |     list[list[k].child[j]].depth=1;
      |                 ^
main.c:44:27: error: request for member 'dom' in something not a structure or union
   44 |     for(j=0;j<list[list[i].dom].k;j++){
      |                           ^
main.c:45:24: error: request for member 'dom' in something not a structure or union
   45 |       list[list[list[i].dom].child[j]].depth+=list[list[i].dom].depth;
      |                        ^
main.c:45:59: error: request for member 'dom' in something not a structure or union
   45 |       list[list[list[i].dom].child[j]].depth+=list[list[i].dom].depth;
      |                                                           ^
main.c:54:31: error: request for member 'id' in something not a structure or union
   54 |     printf("node %d: ",list[i].id);
      |                               ^
main.c:55:35: error: request for member 'key' in something not a structure or union
   55 |     printf("parent = %d, ",list[i].key);
      |                                   ^
main.c:56:34: error: request for member 'depth' in something not a structure or union
   56 |     printf("depth = %d, ",list[i].depth);
      |                                  ^
main.c:57:15: error: request for member 'key' in something not a structure or union
   57 |     if(list[i].key==-1) printf("root, ");
      |               ^
main.c:58:20: error: request for member 'k' in something not a structure or union
   58 |     else if(list[i].k==0) printf ("leaf, ");
      |                    ^
main.c:61:22: error: request for member 'k' in something not a structure or union
   61 |     for(j=0;j<list[i].k;j++){
      |                      ^
main.c:62:20: error: request for member 'k' in something not a structure or union
   62 |       if(j==list[i].k-1){
      |                    ^
main.c:63:24: error: request for member 'child' in something not a structure or union
   63 |     printf("%d",list[i].child[j]);
      |                        ^
main.c:65:28: error: request for member 'child' in something not a structure or union
   65 |       printf("%d, ",list[i].child[j]);
      |                            ^
main.c: At top level:
main.c:14:8: warning: array 'list' assumed to have one element
   14 | intree list[];
      |        ^~~~