3 ms·
I don’t know if this is true for linked-lists/arrays: but it is sometimes true that an O(1) algorithm is slower than an O(n) one, for small ns (hash-table vs. a
by fiddlerwoaroof 6y ago
I don’t know if this is true for linked-lists/arrays: but it is sometimes true that an O(1) algorithm is slower than an O(n) one, for small ns (hash-table vs. a linear search of a list of pairs is one example of this).
For almost all of these questions I’d be concerned about unusual edge cases: like, I believe it’s possible for two processes to share the same IP/Port on Linux, if you set the right socket options.
- fiddlerwoaroof 6y agoYeah, I think SO_REUSEPORT allows that: https://superuser.com/a/1267230 https://superuser.com/a/1267230
- lmilcin 6y agoThanks for this one, I forgot about it. This is relatively new addition, in times past the only way was to listen on separate protocols (one process on TCP and one on UDP, for example).
- SAI_Peregrinus 6y agoIt's also OS (well, network stack) dependent. The most general answer is that it's possible, but you might need a custom network stack to do it.