• 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: The Case of the Missing Case Statement
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The Case of the Missing Case Statement


  • Subject: Re: The Case of the Missing Case Statement
  • From: Chris Page <email@hidden>
  • Date: Sat, 02 May 2015 04:05:50 -0700

> On Apr 29, 2015, at 10:39 AM, S. J. Cunningham <email@hidden> wrote:
>
> Once n >13, the straight function has to go through 13 tests every time while the binary search will only have to go through 4.   Kind of an unfair fight :) That's why I used a random number.

Good point. If I use random numbers and restrict their range to 1-15 there's very little difference in the performance of the two.

> However, as others have pointed out, the overhead of generating the random number may mask any timing differences.

I generated the numbers in advance and put them in a list.

> Never the less, I think the binary search is more elegant ;)

I agree.

--
Chris Page
The other, other AppleScript Chris


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


  • Prev by Date: Re: ql-manage script not working
  • Next by Date: Mail, count of messages
  • Previous by thread: Re: access violation in OS X 10.10.3
  • Next by thread: Mail, count of messages
  • Index(es):
    • Date
    • Thread