Professional Documents
Culture Documents
int parent(int i)
{
return i/2;
}
int left(int i)
{
return 2*i;//1 indexing otherwise 2*i+1
}
int right(int i)
{
return 2*i+1;//1 indexing otherwise 2*(i+1)
}