[Chicago] Problems with Merge Sort???

Lewit, Douglas d-lewit at neiu.edu
Mon Jun 15 06:31:24 CEST 2015


Hey guys,

I'm trying to master the merge sort algorithm and definitely experiencing
some failure.  My merge program works great.  It takes two arrays, and
assuming that they are already sorted, the two sorted arrays get merged
together into one unified sorted array.  So that's not the problem.

The problem is my mergeSort program.  I inserted a couple of print
statements to print out the intermediate results of the recursion, and it
appears that all my program does is break the array down into pieces and
then rebuilds the pieces.... into the original array!  (Could be worse I
guess.  No error messages!  But the output is totally useless.)  I'm
honestly at a loss.  I know I'm really close to the right solution, but
there is something that I'm missing and I can't figure it out.  I've been
struggling with this for a couple days now, and I'm ready to give up.  Can
someone please enlighten me?

Thanks!!!

Best,

Douglas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20150614/c21eafaf/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Merge.py
Type: text/x-python-script
Size: 1293 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/chicago/attachments/20150614/c21eafaf/attachment.bin>


More information about the Chicago mailing list