Now I want to remove a specific employee object from the list ...
You can just use List.remove for this
... fast
In practice, even when you delete an item, there can be an O(1) operation, iteration along the entire length of the O(n) list and, as you suspected, not very fast.
I feel that your problem is better served by the power of a hash map. This is a constant search and delete time. The LinkedHashMap class can meet your needs. It maintains the insertion order in the same way as the linked list, but also has constant insertion and deletion of time.
Tim biegeleisen
source share