) by color in your room. All of your birds are unique (you have of-course verified this by precisely computing each bird's value.)
Let's say you have spent an unhealthy portion of your life collecting and linearly sorting an incredulous amount of plastic birds (You have all birds in order. One day, your nefarious little brother, sneaks into your room, taking one bird and putting it in a wrong position. Which of the following sorting schemes is your best bet at efficiently sorting your precious plastic bird collection?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
There is only 1 bird that is moved (thanks to your brother), so using Merge sort would unnecessarily complicate thing so Merge sort is not that ideal. Radix sort and Heap sort would do the same. Tackling with only portions is better and so Insertion sort is ideal.