Racking my brain over an elegant algorithm for this (Think NetFlix)

Posts   
 
    
MarcoP avatar
MarcoP
User
Posts: 270
Joined: 29-Sep-2004
# Posted on: 19-Mar-2008 20:52:16   

I've been racking my brain over this and I just can't come up with an elegant solution. Imagine you have a list of ten books that you need to rank 1-10. You can rank them in any order and when you rank one, if that rank is already taken, the list needs to reshuffle. for example:

A 1 B - C - D 4 E - F 6

if F goes to one, it should look like:

F 1 A 2 B - C - D 4 E - F 6

Any ideas would be GREATLEY appreciated.