zpostcode
hash table
Dec 22, 2025 4:18 PM

  hash table computer science Actions Cite verifiedCite While every effort has been made to follow citation style rules, there may be some discrepancies. Please refer to the appropriate style manual or other sources if you have any questions. Select Citation Style MLA APA Chicago Manual of Style Copy Citation Share Share Share to social media Facebook X URL https://www.britannica.com/topic/hash-table Give Feedback Feedback Corrections? Updates? Omissions? Let us know if you have suggestions to improve this article (requires login). Feedback Type Select a type (Required) Factual Correction Spelling/Grammar Correction Link Correction Additional Information Other Your Feedback Submit Feedback Thank you for your feedback Our editors will review what you’ve submitted and determine whether to revise the article.

  Print Cite verifiedCite While every effort has been made to follow citation style rules, there may be some discrepancies. Please refer to the appropriate style manual or other sources if you have any questions. Select Citation Style MLA APA Chicago Manual of Style Copy Citation Share Share Share to social media Facebook X URL https://www.britannica.com/topic/hash-table Feedback Written by Stephen Eldridge Stephen Eldridge is a writer and editor of fiction and nonfiction for all ages. Stephen Eldridge Fact-checked by The Editors of Encyclopaedia Britannica Encyclopaedia Britannica's editors oversee subject areas in which they have extensive knowledge, whether from years of experience gained by working on that content or via study for an advanced degree. They write new content and verify and edit content received from contributors. The Editors of Encyclopaedia Britannica Last Updated: Nov 5, 2024 • Article History Table of Contents Ask the Chatbot a Question Ask the Chatbot a Question hash table, in computer science, a dictionary that maps keys to values using a hash function. A hash function is a mathematical function that maps data of arbitrary length to data of a fixed length. Hashing is a highly efficient way of performing certain operations, such as searches, insertions, and deletions. Hash functions are also widely used in cryptography, though not commonly in the form of hash tables.

  A hash table allows stored data to be retrieved from a table more quickly than a simple binary search of the data would allow, because the key being searched for is used to directly identify the index (row, or record) in the table that should be returned. For example, suppose one has a hash table designed to allow one to input a name and return a phone number. The hash table uses an algorithm to convert the name to a value of a fixed length that serves as the index for the table. Thus, hashing the key directs you to a specific place in the table to find the desired information.

  When more than one value is assigned to the same key, this is referred to as a collision. While collisions are not desirable, they are common and can be handled in different ways. One way is to have more than one value stored in a list at each index. This is called chaining. Multiple key values can be stored at the same index, and, when one of those keys is entered, it will be compared with the keys at the index until the correct one is found. Another method is called open addressing. In open addressing, when a collision occurs, one key is moved to a different open slot in the hash table based on a particular search algorithm.

  With chaining, many keys can be divided among the indices. A key and its associated date can be deleted in the same way. Hashing can be effective at dividing up a large number of keys so that searches and other operations on even very large amounts of data go quickly.

  A well-designed hash table can have a time complexity of O(1), or constant time, meaning that the same number of operations will be required to perform the search regardless of how many keys are in the table.

Comments
Welcome to zpostcode comments! Please keep conversations courteous and on-topic. To fosterproductive and respectful conversations, you may see comments from our Community Managers.
Sign up to post
Sort by
Show More Comments
Recommend >
K.B. Hedgewar
  K.B. Hedgewar Indian physician, nationalist, and social organizer Ask the Chatbot a Question More Actions Share Share Share to social media Facebook X URL https://www.britannica.com/biography/K-B-Hedgewar Feedback Corrections? Updates? Omissions? Let us know if you have suggestions to improve this article (requires login). Feedback Type Select a type (Required) Factual Correction Spelling/Grammar Correction Link Correction Additional Information Other Your Feedback Submit...
Benny Blanco
     Benny Blanco at the 65th Grammy Awards A Grammy-nominated songwriter and record producer behind hits for numerous pop artists, Blanco has established himself as one of the prominent hitmakers in contemporary music. (more) Benny Blanco American record producer and songwriter Ask the Chatbot a Question More Actions Share Share Share to social media Facebook X URL https://www.britannica.com/biography/Benny-Blanco Feedback Corrections?...
What Are Baby Koalas Called?
  What Are Baby Koalas Called? Ask the Chatbot a Question More Actions Share Share Share to social media Facebook X URL https://www.britannica.com/science/What-Are-Baby-Koalas-Called Feedback Corrections? Updates? Omissions? Let us know if you have suggestions to improve this article (requires login). Feedback Type Select a type (Required) Factual Correction Spelling/Grammar Correction Link Correction Additional Information Other Your Feedback Submit Feedback Thank you...
How Old Is the Oldest Living Greenland Shark?
     Greenland shark (Somniosus microcephalus) This cartilaginous fish is the world's longest-lived vertebrate. (more) How Old Is the Oldest Living Greenland Shark? Ask the Chatbot a Question More Actions Share Share Share to social media Facebook X URL https://www.britannica.com/animal/How-Old-Is-the-Oldest-Living-Greenland-Shark Feedback Corrections? Updates? Omissions? Let us know if you have suggestions to improve this article (requires login). Feedback Type Select a...
Information Recommendation
Where Is the Wreck of the Titanic?
  Where Is the Wreck of the Titanic? Ask the Chatbot a Question More Actions Share Share Share to social media Facebook X URL https://www.britannica.com/topic/Where-is-the-wreck-of-the-Titanic Feedback Corrections? Updates? Omissions? Let us know if you have suggestions to improve this article (requires login). Feedback Type Select a type (Required) Factual Correction Spelling/Grammar Correction Link Correction Additional Information Other Your Feedback Submit Feedback...
homebrewing
     A homebrewer making beer Homebrewer Ben Amidon brewing an English ale in his kitchen. (more) homebrewing Ask the Chatbot a Question More Actions Share Share Share to social media Facebook X URL https://www.britannica.com/technology/homebrewing Feedback Corrections? Updates? Omissions? Let us know if you have suggestions to improve this article (requires login). Feedback Type Select a type (Required) Factual Correction Spelling/Grammar...
How Many People Were Killed in the September 11 Attacks?
     Flight 93 National Memorial The Tower of Voices at the Flight 93 National Memorial near Shanksville, Pennsylvania, is a musical instrument honoring the 40 victims of the hijacking and crash of United Airlines flight 93 on September 11, 2001. The tower stands 93 feet (28 meters) tall and holds 40 wind chimes, each with a unique musical tone. (more)...
Why Are Scallops So Expensive?
  Why Are Scallops So Expensive? Ask the Chatbot a Question More Actions Share Share Share to social media Facebook X URL https://www.britannica.com/topic/Why-Are-Scallops-So-Expensive Feedback Corrections? Updates? Omissions? Let us know if you have suggestions to improve this article (requires login). Feedback Type Select a type (Required) Factual Correction Spelling/Grammar Correction Link Correction Additional Information Other Your Feedback Submit Feedback Thank you...
What Were the September 11 Attacks?
     September 11 attacks A collection of significant facts about the September 11 attacks. (more) What Were the September 11 Attacks? Ask the Chatbot a Question More Actions Share Share Share to social media Facebook X URL https://www.britannica.com/event/What-were-the-September-11-attacks Feedback Corrections? Updates? Omissions? Let us know if you have suggestions to improve this article (requires login). Feedback Type Select a type...
Saccharomyces cerevisiae
     Saccharomyces cerevisiae The single-celled fungus Saccharomyces cerevisiae, also known as baker's yeast or brewer's yeast, is widely used in food and beverage production. (more) Saccharomyces cerevisiae fungus Ask the Chatbot a Question More Actions Share Share Share to social media Facebook X URL https://www.britannica.com/science/Saccharomyces-cerevisiae Feedback Corrections? Updates? Omissions? Let us know if you have suggestions to improve this article...
Who Planned the September 11 Attacks?
     Osama bin Laden Al-Qaeda leader Osama bin Laden, 1998. (more) Who Planned the September 11 Attacks? Ask the Chatbot a Question More Actions Share Share Share to social media Facebook X URL https://www.britannica.com/topic/Who-planned-the-September-11-attacks Feedback Corrections? Updates? Omissions? Let us know if you have suggestions to improve this article (requires login). Feedback Type Select a type (Required) Factual Correction Spelling/Grammar...
tikkun olam
  tikkun olam Judaism Ask the Chatbot a Question More Actions Share Share Share to social media Facebook X URL https://www.britannica.com/topic/tikkun-olam Feedback Corrections? Updates? Omissions? Let us know if you have suggestions to improve this article (requires login). Feedback Type Select a type (Required) Factual Correction Spelling/Grammar Correction Link Correction Additional Information Other Your Feedback Submit Feedback Thank you for your...