Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5981421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:56:29+00:00 2026-05-22T21:56:29+00:00

For my C++ application, there is a requirement to check if a word is

  • 0

For my C++ application, there is a requirement to check if a word is a valid English dictionary word or not. What is the best way to do it. Is there freely available dictionary that I can make use of. I just need a collection of all possible words. How to make this lookup least expensive. Do I need to hash it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:56:30+00:00Added an answer on May 22, 2026 at 9:56 pm

    With regards to the presence of a word list, it depends on the platform.
    Under Linux, /usr/share/dict/words contains a list of English words
    that might meet your needs. Otherwise, there are doubtlessly such lists
    available on the network.

    Given the size of such lists, the most rapid access will be to load it
    into a hash table. std::unsorted_set, if you have it; otherwise, many
    C++ compilers come with a hash_set, although different compilers have
    a slightly different interface for it, and put it in different
    namespaces. If that still has performance problems, it’s possible to do
    better if you know the number of entries in advance (so the table never
    has to grow), and implement the hash table in an std::vector (or even a
    C style array); handling collisions will be a bit more complicated,
    however.

    Another possibility would be a trie. This will almost certainly result
    in the least number of basic operations in the lookup, and is fairly
    simple to implement. Typical implementations will have very poor
    locality, however, which could make it slower than some of the other
    solutions in actual practice (or not—the only way to know is to
    implement both and measure).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my iPhone application, there is a requirement to save a few log files
Background: I am working on an Android Honeycomb (v3.0) application that has a requirement
In my application one requirement is there, in start up i want some authentication,
I have a web application that has a requirement to take data from an
I am a bit confused: We have a chat application that has a requirement
I have developed a MVC3 application in that I want use the Check boxlist
Situation: there's a table that is managed by application A. Application A inserts and
Some where in the application there is an autogenerated query like SELECT DISTINCT `Name`,`Number`
In my Java application there is a Socket open and data is being read
In my application there is a ListFragment where each item from the list contains

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.