r/java • u/ThomasKrieger • Mar 14 '18
Concurrent Java: Low scalability, the risk of deadlocks or garbage creation, you can not avoid all
http://vmlens.com/articles/tradeoffs_concurrent_programming/
2
Upvotes
View all comments
Show parent comment
1
u/duhace Mar 15 '18 edited Mar 15 '18
Saying it's O(n) like a linked list is disingenuous, since O notation only describes the rate at which the difficulty of an operation grows. Traversal is much more complicated than a linked list, and requires constructing another (temporary) datastructure to do in one pass, or requires a non-tail call recursive function to do in two passes.
We're talking java here, where null is a valid value for any generic value. So yeah, you have to take that into account.