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

WikiQuora

WikiQuora Logo WikiQuora Logo

WikiQuora Navigation

Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Home
  • Add group
  • Feed
  • User Profile
  • Communities
  • Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
Home/ Questions/Q 469

WikiQuora Latest Questions

Saralyn
  • 1
  • 1
SaralynTeacher
Asked: May 21, 20252025-05-21T07:20:33+00:00 2025-05-21T07:20:33+00:00

How does a dictionary work? What type of program and algorithm is used?

  • 1
  • 1

A Python dictionary is a data structure that stores the value in key: value pairs. Values in a dictionary can be of any data type and can be duplicated, whereas keys can’t be repeated and must be immutable.

Example: Here, The data is stored in key:value pairs in dictionaries, which makes it easier to find values.

d = {1: 'Geeks', 2: 'For', 3: 'Geeks'}
print(d)

 

{1: 'Geeks', 2: 'For', 3: 'Geeks'}

In Python a dictionary is a generalised Hashmap – in other words it uses a hash algorithm on the key to transform a key (which could be a string, an integer, float or any other hashable object) into a number. That number is then used to locate that keys place within the hash table.

Because Python is able to use many different data types as keys – there is no one algorthim, There are different algorithms for each builtin data type, and of course custom objects can also provide hash algorithms for themselves too.

What is an algorithm to find a word in a dictionary?

There is quite a range of dictionary-oriented algorithms but they each have their niche. Is this for an actual human language-type dictionary or a simple word-based lookup table? Leveraging a hash table is very common and the basis of many map data structures. Is it for a very large number of dictionary words or a more restricted set (e.g. domain-specific)? (Note: most programming languages already have collections built-in to support direct lookups via associative arrays or maps)

If the solution you’re seeking leans more toward human language-type words, it’ll get more complicated to support root words along with prefix/suffix combinations (e.g. spell check). Also, if exact match isn’t the only dictionary search needed, you may also consider using soundex (phonetic-based) as the key into your hash table. Will real-time results be required for live interaction? If your need is more translation-oriented and the vocabulary is constrained, consider parsing or even a finite state machine can do the job quickly; this is probably not what you desire if for a conventional dictionary. Finally, if these are dictionary entries not memory-contained, now you’re likely venturing into NoSQL territory or a relational database (e.g. indexed).

dictionaryhashmapkey value pairpython
0
  • 0 0 Answers
  • 110 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question
  • Popular
  • Answers
  • W3spoint99

    What is the difference between Promises and Observables?

    • 2 Answers
  • W3spoint99

    Can't bind to 'ngModel' since it isn't a known property ...

    • 2 Answers
  • W3spoint99

    How to prevent SQL injection in PHP?

    • 1 Answer
  • Saralyn
    Saralyn added an answer Learn Java if: ✅ You want to work on enterprise applications.… April 27, 2025 at 2:01 pm
  • Saralyn
    Saralyn added an answer AI is getting smarter, but replacing programmers entirely? That’s not… April 27, 2025 at 1:58 pm
  • Saralyn
    Saralyn added an answer Both Promises and Observables provide us with abstractions that help us deal with the asynchronous nature… January 17, 2025 at 2:03 pm

Trending Tags

AI angular application.properties arrays artificial intelligence coding how Java javascript machine learning mysql nullpointerexception php programmer python reactjs spring springboot sql string

Explore

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

Footer

  • About US
  • Privacy Policy
  • Questions
  • Recent Questions
  • Web Stories

© 2025 WikiQuora.Com. All Rights Reserved

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.