Language: C

#include<stdio.h>

const int LIMIT=100001;
const int NIL=-1;
struct node{
	int p,right,left,depth,height,sibling;
};
node Tree[LIMIT];

int calc_depthAndHeight(int p,int deep){
 	if(Tree[p].left==NIL&&Tree[p].right==NIL){
		Tree[p].depth=deep;
		Tree[p].height=0;
		return 1;
	}else{
		int h1=-1,h2=-1,h3;
		if(Tree[p].left!=NIL)h1=calc_depthAndHeight(Tree[p].left,deep+1);
		if(Tree[p].right!=NIL)h2=calc_depthAndHeight(Tree[p].right,deep+1);
		h3=h1>h2?h1:h2;
		Tree[p].height=h3;
		Tree[p].depth=deep;
		return h3+1;
	}
} 
 
void print(int n){
	for(int i=0;i<n;i++){
		printf("node %d: parent = %d, sibling = %d, ",i,Tree[i].p,Tree[i].sibling);
		int degree=(Tree[i].left!=-1)+(Tree[i].right!=-1);
		printf("degree = %d, depth = %d, height = %d, ",degree,Tree[i].depth,Tree[i].height);
		if(Tree[i].p==-1){
			printf("root\n");
		}else if(degree==0){
 			printf("leaf\n");
		}else{
			printf("internal node\n");
		}
	}
}

int main(){
	int n,l,r,no;
	scanf("%d",&n);
	for(int i=0;i<n;i++)Tree[i].p=Tree[i].sibling=NIL;
	for(int i=0;i<n;i++){
 		scanf("%d %d %d",&no,&l,&r);
		Tree[no].left=l;
		Tree[no].right=r;
		Tree[l].p=Tree[r].p=no;
		Tree[l].sibling=r;
		Tree[r].sibling=l;
	}
 	int p=0;
	for(int i=0;i<n;i++)if(Tree[i].p==NIL)p=i;
	int t=calc_depthAndHeight(p,0);
	print(n);
}

Compiler output:
main.c:8:1: error: unknown type name 'node'; use 'struct' keyword to refer to the type
    8 | node Tree[LIMIT];
      | ^~~~
      | struct 
main.c:8:6: error: variably modified 'Tree' at file scope
    8 | node Tree[LIMIT];
      |      ^~~~
main.c: In function 'calc_depthAndHeight':
main.c:11:19: error: request for member 'left' in something not a structure or union
   11 |         if(Tree[p].left==NIL&&Tree[p].right==NIL){
      |                   ^
main.c:11:38: error: request for member 'right' in something not a structure or union
   11 |         if(Tree[p].left==NIL&&Tree[p].right==NIL){
      |                                      ^
main.c:12:24: error: request for member 'depth' in something not a structure or union
   12 |                 Tree[p].depth=deep;
      |                        ^
main.c:13:24: error: request for member 'height' in something not a structure or union
   13 |                 Tree[p].height=0;
      |                        ^
main.c:17:27: error: request for member 'left' in something not a structure or union
   17 |                 if(Tree[p].left!=NIL)h1=calc_depthAndHeight(Tree[p].left,deep+1);
      |                           ^
main.c:17:68: error: request for member 'left' in something not a structure or union
   17 |                 if(Tree[p].left!=NIL)h1=calc_depthAndHeight(Tree[p].left,deep+1);
      |                                                                    ^
main.c:18:27: error: request for member 'right' in something not a structure or union
   18 |                 if(Tree[p].right!=NIL)h2=calc_depthAndHeight(Tree[p].right,deep+1);
      |                           ^
main.c:18:69: error: request for member 'right' in something not a structure or union
   18 |                 if(Tree[p].right!=NIL)h2=calc_depthAndHeight(Tree[p].right,deep+1);
      |                                                                     ^
main.c:20:24: error: request for member 'height' in something not a structure or union
   20 |                 Tree[p].height=h3;
      |                        ^
main.c:21:24: error: request for member 'depth' in something not a structure or union
   21 |                 Tree[p].depth=deep;
      |                        ^
main.c: In function 'print':
main.c:28:72: error: request for member 'p' in something not a structure or union
   28 |                 printf("node %d: parent = %d, sibling = %d, ",i,Tree[i].p,Tree[i].sibling);
      |                                                                        ^
main.c:28:82: error: request for member 'sibling' in something not a structure or union
   28 |                 printf("node %d: parent = %d, sibling = %d, ",i,Tree[i].p,Tree[i].sibling);
      |                                                                                  ^
main.c:29:36: error: request for member 'left' in something not a structure or union
   29 |                 int degree=(Tree[i].left!=-1)+(Tree[i].right!=-1);
      |                                    ^
main.c:29:55: error: request for member 'right' in something not a structure or union
   29 |                 int degree=(Tree[i].left!=-1)+(Tree[i].right!=-1);
      |                                                       ^
main.c:30:79: error: request for member 'depth' in something not a structure or union
   30 |                 printf("degree = %d, depth = %d, height = %d, ",degree,Tree[i].depth,Tree[i].height);
      |                                                                               ^
main.c:30:93: error: request for member 'height' in something not a structure or union
   30 |                 printf("degree = %d, depth = %d, height = %d, ",degree,Tree[i].depth,Tree[i].height);
      |                                                                                             ^
main.c:31:27: error: request for member 'p' in something not a structure or union
   31 |                 if(Tree[i].p==-1){
      |                           ^
main.c: In function 'main':
main.c:44:36: error: request for member 'p' in something not a structure or union
   44 |         for(int i=0;i<n;i++)Tree[i].p=Tree[i].sibling=NIL;
      |                                    ^
main.c:44:46: error: request for member 'sibling' in something not a structure or union
   44 |         for(int i=0;i<n;i++)Tree[i].p=Tree[i].sibling=NIL;
      |                                              ^
main.c:47:25: error: request for member 'left' in something not a structure or union
   47 |                 Tree[no].left=l;
      |                         ^
main.c:48:25: error: request for member 'right' in something not a structure or union
   48 |                 Tree[no].right=r;
      |                         ^
main.c:49:24: error: request for member 'p' in something not a structure or union
   49 |                 Tree[l].p=Tree[r].p=no;
      |                        ^
main.c:49:34: error: request for member 'p' in something not a structure or union
   49 |                 Tree[l].p=Tree[r].p=no;
      |                                  ^
main.c:50:24: error: request for member 'sibling' in something not a structure or union
   50 |                 Tree[l].sibling=r;
      |                        ^
main.c:51:24: error: request for member 'sibling' in something not a structure or union
   51 |                 Tree[r].sibling=l;
      |                        ^
main.c:54:39: error: request for member 'p' in something not a structure or union
   54 |         for(int i=0;i<n;i++)if(Tree[i].p==NIL)p=i;
      |                                       ^