Language: C

    int left;
    int right;
} Node;
  
int searchHight(int);
  
Node *node;
  
int main(){
      
    int n,i,id,depth,tmpP,deg,nowNode,sibling;
  
    scanf("%d", &n);
  
    node = malloc(sizeof(Node)*n);
  
    for (i = 0; i < n; ++i){
        node[i].p = -1;
    }
  
    for (i = 0; i < n; ++i){
        scanf("%d",&id);
        scanf("%d%d",&node[id].left,&node[id].right);
        node[node[id].left].p = id;
        node[node[id].right].p = id;
    }
  
    nowNode = 0;
    while(1){
        if (node[nowNode].left != -1 && node[nowNode].right != -1)
        {
            break;
        } else if (node[nowNode].left == -1)
        {
            nowNode = node[nowNode].right;
        } else {
            nowNode = node[nowNode].left;
        }
    }
  
    for (i = 0; i < n; ++i){
          
        tmpP = node[i].p;
        if (tmpP == -1) sibling = -1;
        else if(node[tmpP].left == i) sibling = node[tmpP].right;
        else sibling = node[tmpP].left;

        depth = 0;
        while(tmpP != -1){
            tmpP = node[tmpP].p;
            depth++;
        }
  

        deg = 0;
        if (node[i].left != -1) deg++;
        if (node[i].right != -1) deg++;
  
        printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, "
            ,i,node[i].p,sibling,deg,depth,searchHight(i));
  
        if(node[i].p == -1) printf("root\n");
        else if(node[i].left == -1 && node[i].right == -1) printf("leaf\n");
        else printf("internal node\n");
    }
  
    return 0;
}
  
int searchHight(int index){
    int hLeft = 0;
    int hRight = 0;
  
    if (node[index].left != -1){
        hLeft = searchHight(node[index].left) +1;
    }
    if (node[index].right != -1){
        hRight = searchHight(node[index].right) +1;
    }
    if (hLeft < hRight) return hRight;
    else return hLeft;
}

Compiler output:
main.c:3:1: error: expected identifier or '(' before '}' token
    3 | } Node;
      | ^
main.c:3:3: warning: data definition has no type or storage class
    3 | } Node;
      |   ^~~~
main.c:3:3: error: type defaults to 'int' in declaration of 'Node' [-Wimplicit-int]
main.c:7:1: error: unknown type name 'Node'
    7 | Node *node;
      | ^~~~
main.c: In function 'main':
main.c:13:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   13 |     scanf("%d", &n);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 |     int left;
main.c:13:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   13 |     scanf("%d", &n);
      |     ^~~~~
main.c:13:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:15:12: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   15 |     node = malloc(sizeof(Node)*n);
      |            ^~~~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
  +++ |+#include <stdlib.h>
    1 |     int left;
main.c:15:12: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   15 |     node = malloc(sizeof(Node)*n);
      |            ^~~~~~
main.c:15:12: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:18:16: error: request for member 'p' in something not a structure or union
   18 |         node[i].p = -1;
      |                ^
main.c:23:31: error: request for member 'left' in something not a structure or union
   23 |         scanf("%d%d",&node[id].left,&node[id].right);
      |                               ^
main.c:23:46: error: request for member 'right' in something not a structure or union
   23 |         scanf("%d%d",&node[id].left,&node[id].right);
      |                                              ^
main.c:24:22: error: request for member 'left' in something not a structure or union
   24 |         node[node[id].left].p = id;
      |                      ^
main.c:25:22: error: request for member 'right' in something not a structure or union
   25 |         node[node[id].right].p = id;
      |                      ^
main.c:30:26: error: request for member 'left' in something not a structure or union
   30 |         if (node[nowNode].left != -1 && node[nowNode].right != -1)
      |                          ^
main.c:30:54: error: request for member 'right' in something not a structure or union
   30 |         if (node[nowNode].left != -1 && node[nowNode].right != -1)
      |                                                      ^
main.c:33:33: error: request for member 'left' in something not a structure or union
   33 |         } else if (node[nowNode].left == -1)
      |                                 ^
main.c:35:36: error: request for member 'right' in something not a structure or union
   35 |             nowNode = node[nowNode].right;
      |                                    ^
main.c:37:36: error: request for member 'left' in something not a structure or union
   37 |             nowNode = node[nowNode].left;
      |                                    ^
main.c:43:23: error: request for member 'p' in something not a structure or union
   43 |         tmpP = node[i].p;
      |                       ^
main.c:45:27: error: request for member 'left' in something not a structure or union
   45 |         else if(node[tmpP].left == i) sibling = node[tmpP].right;
      |                           ^
main.c:45:59: error: request for member 'right' in something not a structure or union
   45 |         else if(node[tmpP].left == i) sibling = node[tmpP].right;
      |                                                           ^
main.c:46:34: error: request for member 'left' in something not a structure or union
   46 |         else sibling = node[tmpP].left;
      |                                  ^
main.c:50:30: error: request for member 'p' in something not a structure or union
   50 |             tmpP = node[tmpP].p;
      |                              ^
main.c:56:20: error: request for member 'left' in something not a structure or union
   56 |         if (node[i].left != -1) deg++;
      |                    ^
main.c:57:20: error: request for member 'right' in something not a structure or union
   57 |         if (node[i].right != -1) deg++;
      |                    ^
main.c:59:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   59 |         printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, "
      |         ^~~~~~
main.c:59:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:59:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:59:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:60:23: error: request for member 'p' in something not a structure or union
   60 |             ,i,node[i].p,sibling,deg,depth,searchHight(i));
      |                       ^
main.c:62:19: error: request for member 'p' in something not a structure or union
   62 |         if(node[i].p == -1) printf("root\n");
      |                   ^
main.c:63:24: error: request for member 'left' in something not a structure or union
   63 |         else if(node[i].left == -1 && node[i].right == -1) printf("leaf\n");
      |                        ^
main.c:63:46: error: request for member 'right' in something not a structure or union
   63 |         else if(node[i].left == -1 && node[i].right == -1) printf("leaf\n");
      |                                              ^
main.c: In function 'searchHight':
main.c:74:20: error: request for member 'left' in something not a structure or union
   74 |     if (node[index].left != -1){
      |                    ^
main.c:75:40: error: request for member 'left' in something not a structure or union
   75 |         hLeft = searchHight(node[index].left) +1;
      |                                        ^
main.c:77:20: error: request for member 'right' in something not a structure or union
   77 |     if (node[index].right != -1){
      |                    ^
main.c:78:41: error: request for member 'right' in something not a structure or union
   78 |         hRight = searchHight(node[index].right) +1;
      |                                         ^