3 ms·
In fairness to the scene, this was the code in question: https://stackoverflow.com/questions/65753731/why-searching-a-sorted-list-using-brute-forcing-is-funny-
by asdguinui 4y ago
In fairness to the scene, this was the code in question:
https://stackoverflow.com/questions/65753731/why-searching-a-sorted-list-using-brute-forcing-is-funny-to-silicon-valley-show https://stackoverflow.com/questions/65753731/why-searching-a...
Hardly clean, I think you'd agree.
In any case, you shouldn't use explicit iteration to solve this problem without a good reason. Every language should have both linear and binary search as part of its standard library.
- epgui 4y agoUhhh not sure why you were downvoted to oblivion. I can easily see other people disagreeing with you, and I’m not saying I agree, but what you said was not unreasonable. Vouched.
- Jtsummers 4y agoNew accounts whose first comment includes a link tend to get filtered and marked dead without user interaction, it's part of the automated mod system. They basically get caught up in the spam filter, I vouch for them a lot when (like the one you vouched) they are actually contributing.
- epgui 4y agoAh, thanks for the extra context! I did not know this!
- defrost 4y agoCheers for the detail - I only dimly recall it in passing as I'm not much of a TV series consumer. I agree that you shouldn't especially choose one algorithm over another without reason and I feel comfortable choosing a linear scan of short sections of cached data in pipelined situations where branching overheads are steep. Was the case in the TV episode such a scenario? I have no knowledge of that myself.