Skip to content

Zhang-Charlie/Java-Data-Structures-Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Java Data Structures Library

A comprehensive Java library containing core data structures implemented from scratch, including lists, stacks, queues, trees, hash tables, priority queues, and a fully-functional Treap with performance analysis.

This project was developed as part of my Computer Science coursework at University College Dublin, and showcases strong Java fundamentals, algorithmic design, data structure implementation, and benchmarking.


πŸ“Œ Features

βœ”οΈ Lists

  • Singly Linked List
  • Doubly Linked List
  • Circular Linked List

βœ”οΈ Stacks & Queues

  • Array-based Stack
  • LinkedList-based Stack
  • Array Queue
  • LinkedList Queue

βœ”οΈ Trees

  • Binary Tree
  • Binary Search Tree (BST)
  • AVL Tree
  • Red-Black Tree
  • Splay Tree
  • Treap (Randomized BST + heap property)

βœ”οΈ Priority Queue & Heap

  • Binary Heap
  • Priority Queue implementations

βœ”οΈ Hash Table & Maps

  • Custom Hash Table
  • Map / Entry interfaces
  • Collision handling logic

βœ”οΈ Utilities

  • Timer class for benchmarking
  • Benchmark.java driver
  • Utility algorithms (e.g., Bubble Sort for simple comparisons)

🧠 Treap Implementation & Performance Analysis

This project includes a full implementation of a Treap, a randomized balanced binary search tree.
We benchmarked Treap performance and compared it against:

  • AVLTreeMap
  • TreeMap (Java’s built-in Red-Black Tree)

πŸ“Š Research Poster


Treap Performance Poster

This poster illustrates:

  • How a Treap works (BST + heap priority)
  • Performance vs AVLTreeMap / TreeMap
  • Use-cases for randomized balancing
  • Conclusions from our performance testing

πŸ“‚ Project Structure

/src
  /list
  /stacksqueues
  /tree
  /priorityqueue
  /hashtable
  /interfaces
  /utils
Benchmark.java
README.md

Each package contains a fully-implemented data structure and, in many cases, corresponding tests or helpers.


πŸš€ Getting Started

Clone the repository:

git clone https://github.com/Zhang-Charlie/Java-Data-Structures-Library.git

cd Java-Data-Structures-Library

Compile everything:

javac -d out $(find src -name "*.java") Benchmark.java

Run the benchmark:

java -cp out Benchmark


πŸŽ“ Educational Value

This project demonstrates:

  • Understanding of low-level data structure behaviour
  • Balanced tree rotations and priority management
  • Hash table indexing and collision handling
  • Algorithmic time/space complexity
  • Clean object-oriented Java design

It is ideal for learning, interview preparation, or contributing to open-source educational tools.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages