Lets say you have to find a pair of matching socks. You could:
1) grab sock from basket.
2) grab another sock from basket. If it doesn't match throw it to the side. If it matches goto line 4.
3) repeat line 2
4) your done.


How would you go about figuring time complexity of this algorithm or the following one.

1) grab sock from basket lay it on the bed.
2) grab another sock from basket. If it doesn't match any previous socks already on bed lay it on the bed. If it matches any previous socks goto line 4.
3) repeat line 2.
4) your done.

How would you find it from these two cases.

Thanks in advance.
Jack