J
James Kuyper
No, programmers who WON'T perform simple arithmetic that unnecessarily
complicates their code. There's a big difference.
That the transformation can be done, and even that it's easy, doesn't
mean that it's a good idea to perform it. That it's not necessarily a
transformation worth performing, means that it's just plain ridiculous
to misinterpret a refusal to perform it as indicating an inability to
perform it.
complicates their code. There's a big difference.
Were you the person in that old thread who maintained that
heaps couldn't/wouldn't/shouldn't be implemented with anything
other than 1-based arrays? I've forgotten. But it's clear that
no important property of a heap depends on the raw numerical
values of the array indices: As long as you can compute the child
indices from the parent's index and vice versa, you can implement
a heap in an N-based array.
And converting between a one-based index and an N-based
index *is* simple arithmetic.
That the transformation can be done, and even that it's easy, doesn't
mean that it's a good idea to perform it. That it's not necessarily a
transformation worth performing, means that it's just plain ridiculous
to misinterpret a refusal to perform it as indicating an inability to
perform it.