M
To: Flash Coders List
Subject: Re: [Flashcoders] Doing a binary search in AS3?
Hi Jason,
the complexity probably isnt that hard. You have s, you look at
wordlist[wordlist.length/2], you find a g, so clearly you have to repeat
that for the upper half of the list etc. Dictionary is not going to work
g
> (note: these are for Bank of America employees only)
>
>
>
>
>
>
> -Original Message-
> From: flashcoders-boun...@chattyfig.figleaf.com
> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Hans
> Wichman
> Sent: Thursday, May 06, 2010 11:
nk of America employees only)
-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Hans
Wichman
Sent: Thursday, May 06, 2010 11:06 AM
To: Flash Coders List
Subject: Re: [Flashcoders] Doing a binary search in A
Merrill, Jason wrote:
Just compare the middle element, if it is bigger, use the left half,
else use the right half.
I don't follow - can you post an Actionscript example?
//warning, not fully correct, will infinity loop
while(lefthttp://chattyfig.figleaf.com/mailman/listinfo/flashcoders
the most important thing being as Hendrik said that it is sorted, which in
your example it is not.
Say you have:
["apple", "banana", "cherry", "kiwi", "orange", "peach" "pear", "pineapple",
]
and you are looking for banana:
middle element is orange (or kiwi)
take "apple", "banana", "cherry", "kiw
010 10:45 AM
To: Flash Coders List
Subject: Re: [Flashcoders] Doing a binary search in AS3?
Merrill, Jason wrote:
> I understand what a binary search algorithm is, but am wondering how
> that could be implemented on an array in Actionscript (if at all)
> without using methods that would
Merrill, Jason wrote:
I understand what a binary search algorithm is, but am wondering how
that could be implemented on an array in Actionscript (if at all)
without using methods that would defeating the purpose of a binary
search (speed). Anyone have experience in this area?
So for example, if
I understand what a binary search algorithm is, but am wondering how
that could be implemented on an array in Actionscript (if at all)
without using methods that would defeating the purpose of a binary
search (speed). Anyone have experience in this area?
So for example, if you have a list like th
8 matches
Mail list logo