Hi Everyone!
It appears that there were bugs in both of my implementations of Insertion Sort, where the program wouldn't always loop enough to sort some input. I have correct this by using nested for loops just like in Bubble Sort, which I should have done in the first place since Insertion Sort has O(n^2) complexity. Oops!
Thanks to JSchmoe for pointing this out. More sorting tutorials are coming, hopefully with all bugs "squashed" in time.
You can find the updated implementations on my pastebin page.
Comments
No Comments Exist
Be the first, drop a comment!