• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Quicksort Implementation v1.0.2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quicksort Implementation v1.0.2


  • Subject: Re: Quicksort Implementation v1.0.2
  • From: Nigel Garvey <email@hidden>
  • Date: Sat, 2 Aug 2003 17:47:22 +0100

Emmanuel wrote at 08:47 my time:

>However, quicksort is recursive and people who use it live dangerously. For
>instance, you would think that quicksort can safely sort a list of 400
>items, wouldn't you? Now try to sort that list (I'm not considering lists
>of lists here, just ordinary lists of integers):
>
>---------------------
>set x to {}
>repeat with i from 1 to 200
> set end of x to 2 * i
> set end of x to 401 - 2 * i
>end repeat
>---------------------
>
>OMM quicksort returns a stack overflow error on that list.

I think it may depend on the quicksort implementation. Both Arthur's
original handler and the script that Rick's currently developing can
handle much larger lists than that with ease. They're both "in place"
sorts, rearranging the original list rather than breaking it up and
building a new one from the bits.

NG
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: tell Finder to move files
  • Next by Date: Re: Thanks
  • Previous by thread: Fwd: Re: Quicksort Implementation v1.0.2
  • Next by thread: Fwd: Re: Quicksort Implementation v1.0.2
  • Index(es):
    • Date
    • Thread