int parent [ ] = { 1 , 5 , 5 , 2 , 2 , - 1 , 3 } ;
int parent [ ] = { -1 , 0 , 0 , 1 , 1 , 3 , 5 } ; int n = sizeof ( parent ) / sizeof ( parent [ 0 ] ) ; cout << " Height ▁ is ▁ " << findHeight ( parent , n ) ; return 0 ; }