Yesterday I was pairing the socks from the clean laundry and figured out the way I was doing it is not very efficient. I was doing a naive search — picking one sock and
As the architecture of the human brain is completely different than a modern CPU, this question makes no practical sense.
Humans can win over CPU algorithms using the fact that "finding a matching pair" can be one operation for a set that isn't too big.
My algorithm:
spread_all_socks_on_flat_surface();
while (socks_left_on_a_surface()) {
// Thanks to human visual SIMD, this is one, quick operation.
pair = notice_any_matching_pair();
remove_socks_pair_from_surface(pair);
}
At least this is what I am using in real life, and I find it very efficient. The downside is it requires a flat surface, but it's usually abundant.