3 ms·
> The essay has a good point but is not fully correct. The essay's point is that "fully correct" is a meaningless concept without knowing the goal. For exampl
by dalke 11y ago
> The essay has a good point but is not fully correct.
The essay's point is that "fully correct" is a meaningless concept without knowing the goal.
For example, you modified the goal to find the top k elements, and described the standard heap selection method.
Even there, you are not "fully correct". The last time I implemented it was in a situation where I knew that the values were 0.0<=x<=1.0 and where there could be many 1.0 values. If the minimum value in the heap were ever 1.0 then the search could stop, giving sublinear time for some cases.
The essay's point was, find out more of what's needed before answering the question, because in reality few people really need that specific question answered.
- graycat 11y agoWe're in 99.9999% full agreement. The problem I solved with a heap really is the real problem I needed to solve. Long ago when I was relatively knowledgeable in computing, two profs trying to teach a course in computing (I'd been teaching such at Georgetown) asked me about what lessons I would emphasize. I said "A programmer stands between the machine and the real problem, understands the real problem, for a solution finds some appropriate structure, say, divides the work into relatively independent pieces each of which is relatively easy to understand, tries to make the structure relatively robust to likely changes in the real problem, and then programs that." That view was many years ago. I was and I am a big fan of looking at the real problem.