<div dir="ltr"><div>In fact, the algorithm that you implemented in this code is insertion sort. On each iteration you are "merging" a single element with a sorted list of your previously merged elements. That is, you insert a single element into your growing sorted list. This algorithm has time complexity O(n^2), mergesort will have time complexity O(n log n).<br><br></div>Brad<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 15, 2015 at 2:29 AM, Lewit, Douglas <span dir="ltr"><<a href="mailto:d-lewit@neiu.edu" target="_blank">d-lewit@neiu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><font size="4">I sort of got my mergeSort program to work, but the problem is that the algorithm isn't really mergeSort at all!  It uses merge, but my algorithm is iterative rather than recursive, so it's not really a mergeSort.  It's a merge-something, but not true mergeSort.  Oh well.  Any suggestions?  Thanks!</font><div><font size="4"><br></font></div><div><font size="4">Best,</font></div><div><font size="4"><br></font></div><div><font size="4">Douglas.</font></div></div>
<br>_______________________________________________<br>
Chicago mailing list<br>
<a href="mailto:Chicago@python.org">Chicago@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/chicago" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/chicago</a><br>
<br></blockquote></div><br></div>