Thread: Re : binary search

  1. #1

    Unhappy Re : binary search

    Dear All,

    Can anyone tell me at most how many comparisions needed to find an item in a list of size 200 using binary and sequential search.

    For sequential search, it should be (n-1), right? i.e. if a list exist 200 items, it should be (200-1) = 199, but how about binary search, how to formulate this??? Please help.

    Thanks and best regards

  2. #2
    Join Date
    Sep 2001
    The world is waiting. I must leave you now.

  3. #3
    Hi Kim,
    Since 2^8 = 256, 8 comparisons would be adequate for a list of up to 256 items.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. searching and insertion in a binary search tree
    By galmca in forum C Programming
    Replies: 1
    Last Post: 03-26-2005, 05:15 PM
  2. deleting all nodes of a binary search tree...
    By sachitha in forum C++ Programming
    Replies: 3
    Last Post: 09-29-2004, 06:19 AM
  3. Tutorial review
    By Prelude in forum A Brief History of
    Replies: 11
    Last Post: 03-22-2004, 09:40 PM
  4. Request for comments
    By Prelude in forum A Brief History of
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM