Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

16
  • 5
    @Nikolay - This is just copied from cheetahonfire.blogspot.com/2009/05/… which I already read. Is there anything more concerte as I have read conflicting articles. Commented Apr 3, 2013 at 22:13
  • 5
    The main difference is the selection step. The selection sort selects the smallest one and swaps it with the first one The insertion sort inserts the current one in its appropriate position Commented Apr 3, 2013 at 22:14
  • 7
    @eb80 I'm not sure what material you're reading, but I don't see how an example could be more concrete than this? Commented Apr 3, 2013 at 22:15
  • 32
    But what about the number of swaps? Selection always does n(n-1)/2 comparisons, but in the worst case it will only ever do n-1 swaps. In the worst case Insertion will do n(n-1)/2 comparisons as well as n(n-1)/2 swaps. Commented Jan 23, 2015 at 8:07
  • 6
    @Adorn Neither of these are divide and conquer algorithms. Commented Nov 27, 2017 at 17:20