News for hackers. Stuff that matters.
Re:Numbering should start at zero: E.W. Dijkstra by tmtvl on Friday March 21, 2025 @01:10PM (#43438291)
Using an array as a heap is also easier with 1-based indexing:

  base-element := some-vector[i];
  left-child := some-vector[i * 2];
  right-child := some-vector[i * 2 + 1];
where the root element is `some-vector[1]'.

There are no comments on this comment yet.