Jump to content
BrainDen.com - Brain Teasers

Pickett

Members
  • Content Count

    623
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by Pickett

  1. EDIT: I also ran my code on Rainman's algorithm above...it appears to also always work. Nice job!
  2. Disregard my vowel is ALWAYS yellow comment above...I overlooked some...but they are PREDOMINANTLY yellow...but that could just be coincidence...
  3. Yeah, you're probably closer...more trams and people there...
  4. So I agree that in certain sorting algorithms, defining a "step" would be difficult...however, I think with regards to this problem from a practical standpoint, I don't think it's very difficult. A "move" or "step" is simply when you physically grab a DVD and place it in a new position on the shelf...doesn't matter how you do it. In my opinion, if you were to "swap" two DVDs on the shelf (move first to last and last to first)...to me, that is TWO moves, not one. If you decided to do a merge sort on a shelf of DVDs, I would say you are doing a TON of extra moves...while it may be more effici
  5. Ok, so I think I mis-interpreted the OP...it states: To arrange my DVDs with precision I will take one DVD off the shelf and place it in the correct spot back on the shelf. If that's the case, let's look at the example of 2, 4, 1, 3: Start with 1...move it to its correct spot (and shift as needed): 1, 2, 4, 3...then try 2...it's already there...then 3, and move it...1, 2, 3, 4...you're done. However, you can also do this by moving the 2 between 1 and 3 initially: 2, 4, 1, 3 --> 4, 1, 2, 3 --> 1, 2, 3, 4... Which of the above is what you would expect from your OP? Ei
  6. I may have a small error in my code, I need to double check the results above...
×
×
  • Create New...