Binary search on strings

This is a discussion on Binary search on strings within the C++ Programming forums, part of the General Programming Boards category; I want to build a spell checker using binary search. Can anyone guide me how to do the binary search ...

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    1

    Post Binary search on strings

    I want to build a spell checker using binary search.

    Can anyone guide me how to do the binary search on strings.

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,328
    Code:
    std::vector<std::string> list_of_strings;
    // fill and sort list
    
    std::binary_search(list_of_strings.begin(), list_of_strings.end(), string_to_search_for);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. problem in storing data in a binary search tree
    By alavardi in forum C Programming
    Replies: 5
    Last Post: 02-13-2005, 02:20 PM
  2. Tutorial review
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 03-22-2004, 08:40 PM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM
  4. Sorting strings to speed up search?
    By Mox in forum C++ Programming
    Replies: 5
    Last Post: 09-10-2001, 12:17 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21