Algorithm of the Week: Bucket Sort 01.02.2013 Introduction What’s the fastest way to sort the following sequence [9, 3, 0, 5, 4, 1, 2, 6, 8, 7]? Well, the question is a bit tricky since the input is somehow “predefined”. First of all, we have only integers and fortunately they are all different. That’s great and we know that in practice it’s almost impossible to count on such lucky coincidence. However, here we can sort the sequence very quickly. First of all, we can pass through all these integers and by using an auxiliary array we can just put them at their corresponding index.
Read full article from Algorithm of the Week: Bucket Sort | Javalobby
No comments:
Post a Comment