MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

mergeSort with ReplaceRepeated

  • To: mathgroup at
  • Subject: [mg100764] mergeSort with ReplaceRepeated
  • From: Luca Bedogni <bedogni.luca at>
  • Date: Sat, 13 Jun 2009 06:03:37 -0400 (EDT)

   I'm writing an implementation of mergesort using replacerepeated.
This is actually the code:
merge[{a1, arest___}, b : {b1, ___}] /; a1 >= b1 //. {merge[a1, arest, b1]
:> merge[b1, a1, arest] };
but it doesn't work, and I don't know why, because I'm really new to

Any clue?

Luca Bedogni

  • Prev by Date: Re: Creating Matrix from vectors specific issue.
  • Next by Date: Re: Avoid printing leading zero
  • Previous by thread: Re: MergeSort with replacerepeated
  • Next by thread: Re: mergeSort with ReplaceRepeated