Simple data structures and searching for
𝒮ℋ𝒜𝒦ℰ𝒮𝒫ℰ𝒜ℛℰ 's work 🖋️

The following Java program provides different implementation of Symbol tables, which saves distinct words from Shakespeare's work as keys 🗝️ and their number of occurances as values. 🧮


Let's take an example 👀:
"to be or not to be, that is the question"

Word to be or not that is the question
Occurances 2 2 1 1 1 1 1 1

Features

  • Read Shakespeare's work from a text file. 📜
    • Process the text to find how many times a word appears on the text.
  • Symbol table implementations:
    • Linked list-based
    • Array-based
    • Using Linear probing hashing strategy
    • Red-black balanced tree 🔴⚫
  • Outputting the time consumption ⏱️ for each data structure

Starting the program 🏁

  • Clone the project through git clone https://github.com/davi7725/Algorithms-Assignment2.git or just download it as a ZIP file
  • Open the project into an IDE that supports applications
  • Change file path in Program.java to the path of your dataset
  • Start the application by running the Main file

NB❗️ you can download the Shakespeare's works from the hyperlink attached to the word dataset ⬆️

⚠️ Be aware that it will take some time to load the full dataset, therefore coffee ☕️ or tea 🍵 break is advisable.

The Red-Black tree algorithm is commented out due to the fact that it doesn't work well with big arrays (e.g. an array populated with words from the file), BUT you can try it out with a smaller array that you create.


Sources: TreePrinter.java - provided by MightyPork


Assignment made by:

David Alves 👨🏻‍💻 :octocat: Github
Elitsa Marinovska 👩🏻‍💻 :octocat: Github

Attending "Algorithms and Data Structures" course of Software Development bachelor's degree