This project involves implementing a dictionary using two different data structures: HashSet and Trie. The performance of these implementations is analyzed and compared based on their efficiency in performing various operations such as adding, deleting, and checking for the existence of elements.
- HashSet Implementation: Utilizes Java's
HashSetclass to implement dictionary operations. - Trie Implementation: Custom implementation of a Trie data structure to perform dictionary operations.
- Performance Testing: Analyzes and compares the performance of the two implementations.
- Visualization: Graphical representation of the performance analysis using Python's
matplotlib.
├── src
│ ├── HashSetDictionary.java
│ ├── Node.java
│ ├── Trie.java
│ ├── TimeTest.java
│ └── README.md
Implements dictionary operations using Java's HashSet.
Defines the nodes used in the Trie implementation.
Custom implementation of a Trie data structure.
Tests and compares the performance of the HashSetDictionary and Trie implementations.
- Encapsulation: Private variables with public getter and setter methods ensure data hiding and encapsulation.
- HashSet: Efficiently manages dictionary operations using a hash table.
- Trie: Provides an alternative implementation with a tree-like structure for dictionary operations.
- Time Testing: Measures the time taken for add, delete, and contains operations for both implementations.
- Visualization: Graphs illustrate the performance differences between
HashSetandTrie.
To run this project, you need to have Java installed on your system. Clone the repository and compile the Java files:
git clone https://github.com/nikkola01/dictionary-performance-analysis.git
cd dictionary-performance-analysis/src
javac *.javaRun the performance tests:
java TimeTestThe Dictionary Implementation and Performance Analysis project allows you to:
- Add Elements: Add new elements to the dictionary.
- Delete Elements: Remove elements from the dictionary.
- Check Existence: Verify if an element exists in the dictionary.
Extensive testing was conducted to ensure the reliability and accuracy of the system. Key test cases include:
- Adding multiple elements and ensuring they are correctly stored.
- Removing elements and verifying the integrity of the remaining elements.
- Handling erroneous inputs gracefully and maintaining program stability.
Nikola Nikolov [nin6]
Email: Nin6@aber.ac.uk
This project is licensed under the MIT License - see the LICENSE file for details.





