Re: merge sort
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Fri, 28 Dec 2007 17:17:51 -0500
mooon33358@xxxxxxxxx wrote:
I have a little problem with implementing a recursive merge sort
I have to use a function mergesort that takes 3 arguments - an
array, its size, and an help array(i.e mergesort(int [] array, int
size, int[] temp] . I have to use only the temp array for the
sorting, I cant use two help arrays for the sorting, and I cant
change the signature of the function. also have a merge function
that takes 5 arguments - left array and its size, right array and
its size, and final array. I dont have a problem with the merge
function only with the mergesort. can someone post the code for it?
If the array is not essential, see about making the sorted item a
singly linked list. For such, there is adequate mergesort code in
the demonstration uses for hashlib. Lists are intrinsically
unlimited (apart from machine resources) as to size. Mergesort
uses minimal extra storage. See:
<http://cbfalconer.home.att.net/download/> (for hashlib)
--
Merry Christmas, Happy Hanukah, Happy New Year
Joyeux Noel, Bonne Annee, Frohe Weihnachten
Chuck F (cbfalconer at maineline dot net)
<http://cbfalconer.home.att.net>
--
Posted via a free Usenet account from http://www.teranews.com
.
- References:
- merge sort
- From: mooon33358
- merge sort
- Prev by Date: Re: Programming in standard c
- Next by Date: Re: merge sort
- Previous by thread: Re: merge sort
- Next by thread: generic pointer question
- Index(es):
Relevant Pages
|
|