3 ms·
No, it doesn't mean objects in the object-oriented sense. It means something more like "don't build an array and then iterate through it to get the minimum item
by derefr 12y ago
No, it doesn't mean objects in the object-oriented sense. It means something more like "don't build an array and then iterate through it to get the minimum item, if you could just build a minheap." I.e., if you can, use data structures that do the heavy lifting of your algorithms "for free."
- wging 12y agoTotal tangent, but it occurs to me that if all you want is the minimum item, you maybe don't even need a minheap. You can just keep a single item--the smallest--and replace the operation of adding to the array with the operation of compare-and-possibly-replace.
- AgentME 12y agoAs long as you don't need to remove items or update their costs often.