Language: C

#include <stdio.h>
#include <stdlib.h>
#define NIL -1

typedef struct node{
  int parent;
  int left;
  int parent;
}node;

int getSibling(int);
int getDegree(int);
int getDepth(int);
int getHeight(int);
void printTree(void);

node *tree;

int a;

int main(){
  
  int id,left,right,i;
  
  scanf("%d",&a);
  tree = (node *)malloc(sizeof(node)*a);
  for(i=0;i<a;i++){
    tree[i].parent = NIL;
  }
  for(i=0;i<a;i++){
    scanf("%d %d %d",&id,&left,&right);
    
    tree[id].left = left;
    
    tree[id].right = right;
    
    tree[tree[id].left].parent = id;
    
    tree[tree[id].right].parent = id;
  }

  printTree();

  return 0;
}

int getSibling(int c){
  
  int left,right;
  if(tree[c].parent!=-1){
    left = tree[tree[c].parent].left;
    
    right = tree[tree[c].parent].right;

    if(left!=-1&&c!=left) return left;
    
    else if(right!=-1&&c!=right) return right;
  }
  return -1;
}

int getDegree(int c){
  int d=0;
  if(tree[c].left!=-1) d++;
  if(tree[c].right!=-1) d++;
 
  return d;
}

int getDepth(int c){
  int d=0;
  while(tree[c].parent!=-1){
    c=tree[c].parent;
    d++;
  }
  return d;
}

int getHeight(int c){
  int d=0;
  if(tree[c].left==-1&&tree[c].right==-1) return 0;
  if(tree[c].left==-1) return getHeight(tree[c].right)+1;
  if(tree[c].right==-1) return getHeight(tree[c].left)+1;
  if(getHeight(tree[c].left)<getHeight(tree[c].right))
    return getHeight(tree[c].right)+1;
  else return getHeight(tree[c].left)+1;
  return d;
}

void printTree(){
  int i,dep,h;
  for(i=0;i<n;i++){
    dep=getDepth(i);
    h=getHeight(i);
    printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",i,tree[i].parent,getSibling(i),getDegree(i),dep,h);
    if(dep==0) printf("root\n");
    else if(h==0) printf("leaf\n");
    else printf("internal node\n");
  }

  return;
}

Compiler output:
main.c:8:7: error: duplicate member 'parent'
    8 |   int parent;
      |       ^~~~~~
main.c: In function 'main':
main.c:35:13: error: 'node' has no member named 'right'
   35 |     tree[id].right = right;
      |             ^
main.c:39:18: error: 'node' has no member named 'right'
   39 |     tree[tree[id].right].parent = id;
      |                  ^
main.c: In function 'getSibling':
main.c:53:33: error: 'node' has no member named 'right'
   53 |     right = tree[tree[c].parent].right;
      |                                 ^
main.c: In function 'getDegree':
main.c:65:13: error: 'node' has no member named 'right'
   65 |   if(tree[c].right!=-1) d++;
      |             ^
main.c: In function 'getHeight':
main.c:81:31: error: 'node' has no member named 'right'
   81 |   if(tree[c].left==-1&&tree[c].right==-1) return 0;
      |                               ^
main.c:82:48: error: 'node' has no member named 'right'
   82 |   if(tree[c].left==-1) return getHeight(tree[c].right)+1;
      |                                                ^
main.c:83:13: error: 'node' has no member named 'right'
   83 |   if(tree[c].right==-1) return getHeight(tree[c].left)+1;
      |             ^
main.c:84:47: error: 'node' has no member named 'right'
   84 |   if(getHeight(tree[c].left)<getHeight(tree[c].right))
      |                                               ^
main.c:85:29: error: 'node' has no member named 'right'
   85 |     return getHeight(tree[c].right)+1;
      |                             ^
main.c: In function 'printTree':
main.c:92:13: error: 'n' undeclared (first use in this function)
   92 |   for(i=0;i<n;i++){
      |             ^
main.c:92:13: note: each undeclared identifier is reported only once for each function it appears in