Computing the Children and Parents of an Aligned d-Heap
Everything is offset by d-1 to align children to cache lines
- Children of i are at d(i - d + 2), d(i - d + 2) + 1, ... , d(i - d + 2) + d - 1
- Parent of i is at i/d + d - 2
Example d = 4
- Children of 5 are 4(5 - 4 + 2) = 12 , 13, 14, 15
- Parent of 12 is 12/4 + 4 - 2 = 5