Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

mergeSort with ReplaceRepeated

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

Hi
   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
Mathematica.

Any clue?

Regards
--
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