4 ms·
I am not talking about writing a sort. When it comes to providing stock algorithms, most environments are woefully inadequate. I have not yet encountered an e
by anonymoushn 13y ago
I am not talking about writing a sort.
When it comes to providing stock algorithms, most environments are woefully inadequate. I have not yet encountered an environment with a usable maximum_bipartite_matching(), ternary_search(), or bfs(). To be usable, it would need to be easier to convert my problem instance into the types accepted by the library function than to write the code that does the right thing on my types. STL's next_permutation() is the only next_permutation() in any environment I am familiar with, and it does a great job. I believe I've also encountered one stock implementation of binary search that is useful for the case of "binary searching on the answer" (rather than just binary searching in an array), but this isn't a big deal because it saves you maybe 3 LOC.
- jacques_chester 13y agoYou and I have different concepts of stock. I'd be amazed if 80% of what's required in practice isn't all boiling down to search & sort. They're baked into damn near everything, either explicitly or by indirect usage. I don't really know or care which exact elaboration of quicksort that my database engine is using. I'd be unsurprised if there aren't a few that it chooses amongst at plan time. I just say ORDER BY and get on with the rest of my work. Alternatively I could pull the unordered set and write my own sort. And I'd hope to be committed to an institution for the criminally wasteful for such an act.