Posts Tagged ‘sorting’
Selection sort is one of the basic sorting Algorithms. It is pretty simple to understand and very good to implement on small amount of data. However, it becomes quite inefficient when working with large lists.
Selection Sort uses the concept of in-place sorting. It means that the data is sorted by shuffling it within the list. First I shall try to explain the algorithm and then together we would try to carve out of it a basic source code.
Last time, we discussed a sorting technique known as insertion sort. It is a very good sorting procedure and the simplest sorting algorithm for short lists and small amount of data. For larger lists, it’s running time increases exponentially which renders it inefficient. A number of variations have also been introduced to insertion sort, some of which are more efficient and some are equally good. Shell sort and Gnome Sort are two such variations. I prefer Gnome Sort so I will explain it to you in this article.