<div dir="ltr"><font size="4">Brad,</font><div><font size="4"><br></font></div><div><font size="4">You're a genius!  That last email helped me fix my original program.  Hooray!!!  In this version I included a million comments because I'm going to email this to a professor who really doesn't know Python that well.  So the comments may help him to interpret the code a little better.  The only "problem" is that my mergeSort program doesn't change the array "in place".  Not a big deal really.  To permanently change the array you would just do this:</font></div><div><font size="4"><br></font></div><div><font size="4">array = [randint(0, 100) for i in range(20)] #### for example</font></div><div><font size="4">array = mergeSort(array)</font></div><div><font size="4">And presto!  It works!</font></div><div><font size="4"><br></font></div><div><font size="4">The searching and sorting stuff is very cool and challenging, but I still wish that CS professors would also teach some practical stuff, such as web development and internet security, etc, etc.  I've noticed that if you're a CS major they make you struggle through about 2 years of purely academic and theoretical stuff before they start teaching the skills needed for employment as a computer professional.  I mean the Merge Sort algorithm is interesting, and I can see its value, but it would be nice if my professors at the university would teach me how to test a website for security weaknesses and practical stuff like that.  Oh well.  Maybe next semester, right?</font></div><div><font size="4"><br></font></div><div><font size="4">Again Brad, I really appreciate your help.  I love you guys at ChiPy!</font></div><div><font size="4"><br></font></div><div><font size="4">Take care and have a great week.</font></div><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><font size="4"><br></font></div><div><font size="4">P.S.  Regarding merge<b><u>S</u></b>ort vs. merge<b><u>s</u></b>ort, after three semesters of Java programming at Northeastern it's the naming style that I've gotten used to.  Probably not really a big deal, right?  It's just a matter of personal preference.</font></div><div><font size="4"><br></font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 15, 2015 at 6:08 AM, Brad Martsberger <span dir="ltr"><<a href="mailto:bradley.marts@gmail.com" target="_blank">bradley.marts@gmail.com</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"><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"><div><div class="h5">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></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><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></div></div>_______________________________________________<br>
Chicago mailing list<br>
<a href="mailto:Chicago@python.org" target="_blank">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>
<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>