/Hash-Table

A hash table data structure written using Java. The hash table sorts through data and assigns key values to each data component in order to determine where that data will be stored in the table.

Primary LanguageJavaMIT LicenseMIT

Java Hash Table

Description

Hash Table Data Structure Created using Java
The hash table is an important data structure that is often used for encrytpion purposes in modern programming. It is also used to gather and organize data. Hash tables often reduce the amount of time taken to access data given the various classes and functions invovled with the structure. A picture of a hash table is included below this description to help visualize the data structure. To learn more about hash tables in Java, click the link under the "Resources for Project" section. The hash table included in this repository was created as a project for my Software Design III (CS 340) class at the University of Wisconsin - La Crosse. I created my hash table using the Java programming language as well as an Integrated Development Environment (IDE) called Eclipse. In order to view this project, I would recommend installing the Eclipse IDE as well as Java if you do not already have these tools on your computer. If you wish simply to view the code, a simple text editor can be used. However, I would use an IDE such as Eclpse or Visual Studio Code given the amount of code in the project files.

Picture of a Hash Table Data Structure

hash-table

 

Resources for Project:

Running / Viewing the Project

Eclipse (IDE)

  1. First, make sure that you have the Eclipse IDE to run the program. If you need to download Eclipse, the link is provided below.
    -Eclipse (IDE) Download: https://www.eclipse.org/downloads/
  2. Next, make sure that you have Java installed in your system. Go to your settings/system preferences and search for Java in your system. If you do not already have Java installed, follow the link below. The link will bring you to a website for downloading Java. The website will give you the option to download Java for Mac or Windows.
    -Java Download: https://java.com/en/download/help/download_options.html
  3. On this repository page, go to the "Code" button and click the "Download Zip" option.
  4. Go to your "Downloads" section on your computer and place the zip file in a folder/location other than "Downloads".
  5. Double click on the zip file to open or "unzip" it so you can access the file contents.
  6. Open up Eclipse, and type "Hash-Table" as the name of the workspace. Then click the "launch" button.
  7. If any settings options appear, click the "Hide" option located in the upper righthand corner of the screen.
  8. You should now see a workspace. You will probably NOT see any files. To get the actual file content into the workspace, click on the "Import projects" option.
  9. Click the "General" dropdown arrow option. Then double click "Projects from Folder or Archive". This should open a separate Eclipse window.
  10. In the separate Eclipse window, select the "Directory..." button. This should open your file system window. In the file system window, navigate to the location where the "Hash-Table-master" folder is stored.
  11. Select the "Hash-Table-master" folder. Click "Open". This will add the path the the directory in the separate Eclipse window you have opened.
  12. Then in the separate Eclipse window, click "Finish".
  13. Open the project folder that should now be in your workspace by double clicking it. Then open the "src" folder by double clicking it, and then the "(default package)" folder by double clicking it.
  14. Next, open the "HashTableDriver.java" file by clicking it. Hit the green run icon, which is a green circle with a white triangle inside of it. The program should run, and you should see output in the console within Eclipse.
  15. If you are curious about the provided text files (the text files that are named: "find", "out", "read", and "remove"), I encourage you to play around with the code and see how you might incorporate / view the text file data using the hash table in this project.

Command Line

  1. First, make sure that you have your terminal open. Information about your terminal can be found here:
    -Mac: https://support.apple.com/guide/terminal/open-or-quit-terminal-apd5265185d-f365-44cb-8b09-71a064a42125/mac
    -Windows: https://docs.microsoft.com/en-us/windows/terminal/
  2. Next, make sure that you have Java installed in your system. Go to your settings/system preferences (do this on your computer and not in your terminal) and search for Java in your system. If you do not already have Java installed, follow the link below. You will be brought to a website for downloading Java. The website will give you the option to download Java for Mac or Windows.
    -Java Download: https://java.com/en/download/help/download_options.html
  3. On this repository page, go to the "Code" button and click the "Download Zip" option.
  4. Go to your "Downloads" section on your computer and place the zip file in a folder/location other than "Downloads".
  5. Double click on the zip file to open or "unzip" it so you can access the file contents.
  6. In your opened terminal, navigate to the location where you opened the downloaded zip file and make sure you are inside of the "Hash-Table-master" folder. (If you are unsure of command line commands, see the resources provided bellow.)
    -Linux and Max: http://mally.stanford.edu/~sr/computing/basic-unix.html
    -Windows: https://blogs.umass.edu/Techbytes/2014/11/14/file-navigation-with-windows-command-prompt/
  7. Inside the "Hash-Table-master" folder on your terminal, navigate into the "src" folder.
  8. Inside of the "src" folder, type the following command: javac HashTableDriver.java. It is important that you include the "c" at the end of "java" (no spaces).
  9. After typing the command above, type this command: java HashTableDriver.java. Do NOT include a "c" at the end of "java" in this command.
  10. After running the command in the previous step, output should be printed out on your terminal window.
  11. If you are curious about the provided text files (the text files that are named: "find", "out", "read", and "remove"), I encourage you to play around with the code and see how you might incorporate / view the text file data using your terminal.

 

@Author: Andrew Krause
LinkedIn: https://www.linkedin.com/in/andrew-krause-b6aa21179/
Portfolio: https://andrewkrause.dev/
Instagram: https://www.instagram.com/aek.krause/
Facebook: https://www.facebook.com/andrew.krause.35325