What is the most stunning algorithm you know? And by stunning I mean algorithm, which resembles pure magic for the unprepared programmer.