[Chicago] Not exactly a solution, but....
Brad Martsberger
bradley.marts at gmail.com
Mon Jun 15 13:08:46 CEST 2015
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).
Brad
On Mon, Jun 15, 2015 at 2:29 AM, Lewit, Douglas <d-lewit at neiu.edu> wrote:
> 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!
>
> Best,
>
> Douglas.
>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> https://mail.python.org/mailman/listinfo/chicago
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20150615/07034e55/attachment.html>
More information about the Chicago
mailing list