|
|
|
|
|
by tukasqu
2966 days ago
|
|
Think of it this way - if all the boxes are sorted then everyone finds their own number in their box. But let's say that everything is sorted except your's and some other prisoner's number. Then it makes sense to follow the chain, because there is only one chain of two nodes. Basically any number that is in its place is sorted and thus not part of a chain. Any number that is not in its place is not sorted and part of a chain. There can be many different chains, but only one chain that leads to your number. By starting from your own box, you guarantee that you follow your own chain thus reducing the search space. Maybe it helps to understand... |
|