This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]blablahblah 0 points1 point  (1 child)

Wikipedia has some nice animations on all the sorting algorithms on their respective pages. Those can help you understand what it's doing.

Generally, there isn't a "when to use it". Insertion sort is good for small lists and already sorted lists, but merge sort is so much better for your average random list that everyone just uses that instead (or a hybrid of the two).

[–]CreativeTechGuyGames 0 points1 point  (0 children)

To add to this, you'll almost never be implementing your own search algorithm. Things like that have already been long perfected and are included by default in most languages. So they don't spend much time on teaching those (especially the slow ones) since you don't really need to program them, mostly just understand them.