You're Doing It Wrong (Optimize trees for page access) https://queue.acm.org/detail.cfm?id=1814327 A common way to store a binary heap is so that the children of n are located at {2n, 2n+1}. This has the effect that parent and child are usually located in different memory pages if the tree is big. Traversing the tree is faster if it's stored so that each page contains a small subtree that is a few levels deep.
Handmade Network https://handmade.network/ A community of programmers producing quality software through deeper understanding