[Tutor] Python Programming for the absolute beginner 3e, Ch3 Challenge 4

Prasad, Ramit ramit.prasad at jpmorgan.com.dmarc.invalid
Mon Aug 12 17:20:34 CEST 2013


(some Attributions lost due to HTML->TXT conversion)

ALAN GAULD wrote:
> > Also don't know how to do a binary chop, but the book hasn't covered anything
> > like that - it has just taught if, else and while,
> 
> A binary chop is an algorithm. All you need is if/else and while.
> The algorithm looks a bit like this:
> 
> while not found
>        determine the middle value between min  and max
>        if value > target set max to value
>        if value < target set min to value
>        else found = True

Also known as Binary search; binary chop was not a name I had
heard before either.
http://en.wikipedia.org/wiki/Binary_Search


~Ramit



This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email.  


More information about the Tutor mailing list