In computing, a hash table (hash map) is a data structure that implements an associative array abstract data type, a structure that can map keys to values. A hash table uses a hash function to compute an index, also called a hash code, into an array of buckets or slots, from which the desired value can be found.
During lookup, the key is hashed and the resulting hash indicates where the corresponding value is stored.
Ideally, the hash function will assign each key to a unique bucket, but most hash table designs employ an imperfect hash function, which might cause hash collisions where the hash function generates the same index for more than one key. Such collisions are always accommodated in some way.
In a well-dimensioned hash table, the average cost (number of instructions) for each lookup is independent of the number of elements stored in the table. Many hash table designs also allow arbitrary insertions and deletions of key-value pairs, at (amortized) constant average cost per operation.In many situations, hash tables turn out to be on average more efficient than search trees or any other table lookup structure. For this reason, they are widely used in many kinds of computer software, particularly for associative arrays, database indexing, caches, and sets.

View More On Wikipedia.org
  • 2

    josher

    Well-known Member
    • Posts
      6,745
    • Likes
      176
    • Points
      0
  • 2

    Ripon_Manikganj

    • Posts
      129
    • Likes
      3
    • Points
      0
  • 1

    Shikderg

    • Posts
      4,168
    • Likes
      321
    • Points
      0
  • 1

    INSP DDK

    Well-known Member
    • Posts
      1,638
    • Likes
      28
    • Points
      0
  • 1

    anowar_virus

    Active Member From Hanoi
    • Posts
      403
    • Likes
      0
    • Points
      16
  • 1

    dhakagsm

    Junior Member
    • Posts
      50
    • Likes
      0
    • Points
      0
  • Top