Preview

Hash Tables

Good Essays
Open Document
Open Document
565 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Hash Tables
Mark Radice
SD290
Hash Tables

The term Hash Search refers to a search, in which they key, through an algorithmic function, determines the location of the data. In essence, the goal is to find the data with only one search. The hash search runs very quickly because of this. It's Big O, or orders of power, approaches O(1) and will never exceed O(n). To accomplish this search, a program is written in which the key is passed into the hash function, which in turn, finds the address of the data needed. To start with, the function will take in a string of characters. It will then convert those characters to an ASCII value and add them together giving it a yield or position.

The first step is simply inputting a string of characters. The program then is designed to convert those characters to an ASCII value. Those values are then added together to give it an initial index value inside your set table. The function will continue to run as long as data needs to be stored. It will continue to cycle through placing data into the proper locations based upon your math formula. This sounds like it would be a perfect table of data that is easily searchable except there is a bit of a problem.

The problem comes in when two pieces of data produce the same yield. The table will try to store this into the same place as the other data with that index number. These data that share the same index are referred to as synonyms. When the function attempts to place multiple pieces of data into the same index position, the computer encounters what is called a collision. The address, or index, produced by the hashing algorithm is known as the home address. The memory that contains all of the home addresses is known as the prime area. When two keys collide at a home address, we must resolve the collision by placing one of the keys and its data into a new location.

Another algorithm is commonly used to solve the collision problem. Often times simply dividing the

You May Also Find These Documents Helpful

  • Good Essays

    Arrays store items that have the same type of data type like a group of employees’ names and social security numbers for a team of 2000 personal. Pointer is a variable that greatly extends the power and flexibility of a program, each memory location that is used to store data value has an address. The address provides the means for a PC hardware to reference a particular data item.…

    • 485 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    C 1D Collisions PhET Lab

    • 662 Words
    • 4 Pages

    Take some time to familiarize yourself with the simulation and perfect collisions. Play. Investigate. Learn.…

    • 662 Words
    • 4 Pages
    Powerful Essays
  • Satisfactory Essays

    1. It keeps a count of the number of times you want to use the program to input data…

    • 351 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Medical Coding

    • 450 Words
    • 2 Pages

    I. The first step in coding is to locate the main term in the Alphabetic Index.…

    • 450 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Nt1420 Unit 6

    • 1145 Words
    • 5 Pages

    Question 6 A hash table is a data structure that uses an array as its internal storage container. Items are added to the array based on the integer generated by a hash function. A hash function produces an integer based on some properties of the object. In Java hash functions are encapsulated via the hashcode method in the Object class and that many classes override.…

    • 1145 Words
    • 5 Pages
    Good Essays
  • Good Essays

    Assingment2

    • 906 Words
    • 3 Pages

    Indexes are used to boost performance in a database. Finding an individual record or set of records most efficiently done by Index. Index key is the reference point where an index is an ordered arrangement of keys and pointers. Each key is appointed to the location of the data recognized by the key. For example: when we print out at the NEU library we have given our User ID so when we print out we can easily find the documents.…

    • 906 Words
    • 3 Pages
    Good Essays
  • Better Essays

    Case 35

    • 4682 Words
    • 19 Pages

    Information from such statements is fed into the computer, which then calculates key ratios for…

    • 4682 Words
    • 19 Pages
    Better Essays
  • Satisfactory Essays

    Information Technology

    • 760 Words
    • 4 Pages

    In file hashing, a file is read by a special algorithm that uses the value of the bits in the file to compute a single large number called a ____ value.…

    • 760 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    In order to write this program, two variables, ROWNUM and COLUMNNUM, will be used with nested repetition loop to complete the necessary calculations. ROWNUM will be used in an outerloop and contain numbers between1-10 and COLUMNNUM will be used in an innerloop and contain numbers between 1-10. For each iteration of the outerloop, the inner loop will be executed 10 times and the product of ROWNUM*COLUMNNUM will produce the multiplication table of ROWNUM. The ROWNUM and COLUMNNUM variables will be incremented by 1in each iteration of loops. The new line will be printed to display the multiplication table for each value of ROWNUM in a separate line.…

    • 345 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    Relational Databases

    • 4830 Words
    • 20 Pages

    Contrast the logical and the physical view of data and discuss why separate views are necessary in database applications. Describe which perspective is most useful for each of the following employees: a programmer, a manager, and an internal auditor. How will understanding logical data structures assist you when designing and using database systems?</para></question><question id="ch04ques02" label="4.2">…

    • 4830 Words
    • 20 Pages
    Better Essays
  • Better Essays

    Is3230 Lab 1 PKI Analysis

    • 851 Words
    • 4 Pages

    A PKI (public key infrastructure) enables users of a basically unsecure public network such as the Internet to securely and privately exchange data and money through the use of a public and a private cryptographic key pair that is obtained and shared through a trusted authority. The private key system is sometimes known as symmetric cryptography and the public key system as asymmetric cryptography. The Hash algorithm (or hash function) is an algorithm that computes a value based on a data object such as a message or file. The object is usually of variable length, possibly very large, thereby mapping the data object to a smaller data object. This is the “hash result” which is usually a fixed-size value.…

    • 851 Words
    • 4 Pages
    Better Essays
  • Satisfactory Essays

    In this experiment, two object collided both elastically and in inelastically, the purpose of this experiment is to study the principle of conservation of momentum in collisions using two bodies. We also calculated the amount of kinetic energy in elastic and inelastic collisions before and after the collision.…

    • 472 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Relational Database

    • 632 Words
    • 3 Pages

    To create a family reunion database using Microsoft Access, we first need to break down the information currently available to us.…

    • 632 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Database

    • 317 Words
    • 2 Pages

    Describe the ways in which database technologies could be used by an office stationery supply company to achieve low-cost leadership.…

    • 317 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Science Flash Cards

    • 832 Words
    • 4 Pages

    If two objects with different masses and traveling with different velocities collide, what law allows you to predict the motion of the objects after the collision?…

    • 832 Words
    • 4 Pages
    Good Essays