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 6760169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:02:07+00:00 2026-05-26T14:02:07+00:00

When you perform a lookup in a Hashtable, the key is converted into a

  • 0

When you perform a lookup in a Hashtable, the key is converted into a hash. Now using that hashed value, does it directly map to a memory location, or are there more steps?

Just trying to understand things a little more under the covers.

And what other key based lookup data structures are there and why are they slower than a hash?

  • 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-26T14:02:07+00:00Added an answer on May 26, 2026 at 2:02 pm

    A Hash (aka Hash Table) implies more than a Map (or Associative Array).

    In particular, a Map (or Associative Array) is an Abstract Data Type:

    …an associative array (also called a map or a dictionary) is an abstract data type composed of a collection of (key,value) pairs, such that each possible key appears at most once in the collection.

    While a Hash table is an implementation of a Map (although it could also be considered an ADT that includes a “cost”):

    …a hash table or hash map is a data structure that uses a hash function to map identifying values, known as keys […], to their associated values […]. Thus, a hash table implements an associative array [or, map].

    Thus it is an implementation-detail leaking out: a HashMap is a Map that uses a Hash-table algorithm and thus provides the expected performance characteristics of such an algorithm. The “leaking” of the implementation detail is good in this case because it provides some basic [expected] bound guarantees, such as an [expected] O(1) — or constant time — get.

    Hint: a hash function is important part of a hash-table algorithm and sets a HashMap apart from other Map implementations such as a TreeMap (that uses a red-black tree) or a ConcurrentSkipListMap (that uses a skip list).

    Another form of a Map is an Association List (or “alist”, which is common in LISP programming). While association lists are O(n) for get, they can have much less overhead for small n, which brings up another point: Big-Oh describes limiting behavior (as n -> infinity) and does not address the relative performance for a particular [smallish] n:

    A description of a function in terms of big O notation usually only provides an upper bound on the growth rate of the function.

    Please refer to the links above (including the javadoc) for the basic characteristics and different implementation strategies — anything else I say here is already said there (or in other SO answers). If there are specific questions, open a new SO post if warranted 🙂

    Happy coding.


    Here is the source for the HashMap implementation that is in OpenJDK 7. Looking at the put method shows that it a simple chaining as a collision-resolution method and that the underlying “bucket array” will grow by a factor of 2 each resize (which is triggered when the load factor is reached). The load factor and amortized performance expectations — including those of the hashing function used — are covered in the class documentation.

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

Sidebar

Related Questions

How do I perform a reverse DNS lookup, that is how do I resolve
I was wondering how does the F# immutable Map perform against the standard Dictionary.
I have a char** that I frequently need to insert into or perform a
I am using Indy to perform a reverse IPv4 lookup using the following code.
I have looked at the key-value database Redis and am curious about alternatives that
I am trying to perform a JNDI-lookup from within the GWT devmode. I have
I would like to use client-side Javascript to perform a DNS lookup (hostname to
I am trying to perform what I believe is a difficult recursion using a
I have a a number of jar files that perform rmi. These are all
I am developing a web app in Rails that needs to perform computationally intensive

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.