Jump to content
  • Join the online East Midlands astronomy club today!

    With active forums, two dark sites and a knowledgeable membership, East Midlands Stargazers has something for everyone.

Unidentified structure!


dawson
 Share

Recommended Posts

The letter in the background of the shot is a letter to me about my back haha, it's nothing to do with a patient, in case anyone wondered.


 


James

Link to comment
Share on other sites

The letter in the background of the shot is a letter to me about my back haha, it's nothing to do with a patient, in case anyone wondered.

James

I did clock that James ;)

Link to comment
Share on other sites

I was a little amused with the phrase "Pairing my socks" so I found this on google.


 


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 "iterating" the pile in order to find its pair. This requires iterating over n/2 * n/4 = n2/8 socks on average.


As a computer scientist I was thinking what I could do? Sorting (according to size/color/...) of course came into mind to achieve an O(NlogN) solution.


Hashing or other not-in-place solutions are not an option, because I am not able to duplicate my socks (though it could be nice if I could).


So, the question is basically:


Given a pile of n pairs of socks, containing 2n elements (assume each sock has exactly one matching pair), what is the best way to pair them up efficiently with up to logarithmic extra space? (I believe I can remember that amount of info if needed.)


 


So sad  :lol:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.