I have... a method using contains() on a list vs a HashSet(). In one instance the O(n) caused the method to run in 20-30 seconds. The O(1) ran in milliseconds. Just simple stuff like that can kill you if you don't have a basic foundation of knowledge.
Comments
I have... a method using contains() on a list vs a HashSet(). In one instance the O(n) caused the method to run in 20-30 seconds. The O(1) ran in milliseconds. Just simple stuff like that can kill you if you don't have a basic foundation of knowledge.