Re: The Case of the Missing Case Statement
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