Asymptotically Optimal Algorithms 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 +...) &lt; 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?
We usually only care about the worst-case complexity of algorithms. An $O(n)$ algorithm is usually asymptotically optimal (assuming $n$ is the input size), since most functions require you to read the entire input in some cases.

Another example in which you can prove asymptotic optimality is comparison-based sorting algorithms. A comparison-based sorting algorithm is a sorting algorithm whose only access to the data is a comparison oracle, which compares to data items. Any such algorithm must make $\Omega(n\log n)$ oracle queries in the worst case. Therefore a comparison-based sorting algorithm running in time $O(n\log n)$ is asymptotically optimal.

In most cases, however, we cannot prove that a given algorithm running in superlinear time is optimal, since we don't know how to prove running time lower bounds on general computation models. However, in some cases we can prove such lower bounds conditionally, that is, assuming some widely believed hypothesis. This is known as fine-grained complexity theory, and it indicates (conditionally) that the best algorithms for many problems are indeed asymptotically optimal.