I am confused how to check if an algorithm I made is asymptotically optimal. At the very least, the running time is constant at O(4). This is because you will need to check at least 4 names.At the very most, the running time is linear at O(n). This is from n + n + n/2 + n/2 + n/4 + n/4 + .... = 2n * (1 + 1/2 +...) < 2n. As we ignore constants its just O(n). I checked on Wiki and it said that the algorithm should perform at worst a constant factor of the best algorithm. But if you invented an algorithm then how do I figure this out? 
Asymptotically Optimal Algorithms
algorithms;algorithm analysis;asymptotics