zpostcode
hash table
Sep 11, 2025 12:35 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 >
polydactyly
  polydactyly, condition that is present at birth in which a person has more than five fingers on a hand or more than five toes on a foot. The term polydactyly is derived from the Greek words poly, meaning “many,” and daktylos, meaning “digit.” Polydactyly occurs in an estimated 1 in 500–1,000 births, with variation from 1 in roughly 1,330 births...
reactive attachment disorder
  reactive attachment disorder, rare condition in which infants and young children fail to form emotional bonds with their parents or other caregivers. The disorder is associated with trauma or other stressors that typically result from neglect or physical or emotional abuse and that affect early development. An estimated 1 to 2 percent of children are affected by reactive attachment disorder....
plantar fasciitis
  plantar fasciitis, swelling or degeneration of the plantar fascia, the thick band of connective tissue that runs across the bottom of the foot and connects the heel bone to the toes. Plantar fasciitis causes dull or stabbing pain, typically after a long period of rest, such as sleeping or sitting. The term fasciitis means “inflammation of the fascia”; however, because...
separation anxiety disorder
  separation anxiety disorder, condition characterized by intense and prolonged concern, dread, worry, or apprehension about being separated from a loved one. Separation anxiety disorder is associated with significant distress, to the degree that it interferes with the affected individual’s ability to function, and can negatively impact mental health, academic and professional performance, and relationships with family and peers.   Separation anxiety...
Information Recommendation
sport climbing
  sport climbing, a type of rock climbing in which climbers ascend a route that is equipped with preplaced permanent bolts, rather than placing temporary bolts as they climb and removing them on their descent, as is done in traditional rock climbing. It is a form of free climbing, meaning that upward progress is determined solely by the strength and movement...
Popemobile
     Pope Francis in a PopemobilePope Francis waving to a crowd while riding in a Popemobile during World Youth Day in Portugal, 2023.(more)Popemobile, motorized vehicle used to transport the pope, the leader of the Roman Catholic Church, when he greets the public. The term has been used to describe any number of specially designed vehicles by automobile brands such as...
intracellular fluid
     cell See all media Category: Science & Tech Related Topics: cell fluid cytoplasm cytosol (Show more) See all related content → intracellular fluid, substance within living cells that is made up primarily of water and molecules such as dissolved ions and is a major component of the cytoplasm and cytosol. A variety of chemical reactions within cells take place...
10 Organisms Named for David Attenborough
     David Attenborough: An explorer's lifeSir David Attenborough might have the most-recognizable voice in the world.(more)See all videos for this articleWith his signature voice and familiar demeanor, naturalist David Attenborough has been hailed as one of the greatest broadcasters of our time. A passionate environmentalist and educator, Attenborough has inspired and informed viewers all over the globe with his engaging...
Summer Olympic Games
  Occurring every four years—provided there is no global war or pandemic—the Summer Olympic Games bring together athletes from across the world to compete for the love of country and sport. While the slate of events has changed over the years, with sports regularly being added and removed, perennially popular sports persist—including gymnastics, swimming, diving, volleyball, and track and field. The...
rhombus
  rhombus, a four-sided, or quadrilateral, geometric figure in which all four sides are of the same length and each of the two pairs of opposite sides are parallel to each other. The word rhombus comes from the Greek rhombos, meaning “a spinning top” or “a piece of wood whirled on a string.” Rhombuses can be seen in everyday life, in...
geothermal heat pump
  A geothermal heat pump (GHP) is a heating and cooling system that takes advantage of the relatively stable moderate temperature conditions within the first 300 meters (1,000 feet) below the surface of the Earth to heat a building in the winter and cool it in the summer. Unlike boilers or furnaces, GHPs do not rely on the combustion of fossil...
Proxima Centauri
     Proxima Centauri bArtist's impression of the surface of Proxima Centauri b, one of the closest extrasolar planets to the Sun. The planet has a mass at least 1.3 times that of Earth.(more)Proxima Centauri is the closest star to the Sun, about 4.2 light-years away in the Alpha Centauri system. As a red dwarf star—the most common type of star—Proxima...