Skip to content

tzontsintzos/DataStructuresJava

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Structures Java - University Projects

This repository contains implementations of fundamental data structures and algorithms developed as part of the Data Structures course at AUEB (Athens University of Economics and Business).

Repository Structure

DataStructuresJava/
├── assignment1/          # Stack, Queue implementations and HTML tag validator
├── assignment2/          # Task scheduling with greedy algorithm
├── assignment3/          # Documentation and screenshots
├── etc/                  # Alternative implementations and build artifacts
└── README.md

Assignment 1: Basic Data Structures (assignment1/)

Implementation of fundamental data structures using generic types:

Core Data Structures:

  • StringStack - Generic stack implementation with standard operations (push, pop, peek)
  • IntQueue - Generic queue implementation with enqueue/dequeue operations
  • Node - Node-based data structure for linked implementations

Application:

  • TagMatching - HTML tag validator using stack-based parsing
    • Validates matching opening and closing HTML tags
    • Uses stack to track nested tag structure
    • Reports whether an HTML file has properly matched tags

Key Files:

  • StringStack.java / StringStackImpl.java - Stack interface and implementation
  • IntQueue.java / IntQueueImpl.java - Queue interface and implementation
  • Tagmatching.java - HTML tag validation application
  • Main.java - Test cases demonstrating stack and queue operations

Assignment 2: Task Scheduling Algorithm (assignment2/)

Implementation of a greedy algorithm for load balancing tasks across multiple processors:

Components:

  • MaxPQ - Max Priority Queue implementation for processor management
  • Greedy Algorithm - Schedules tasks to minimize makespan (maximum completion time)
  • Task - Represents a task with ID and execution time
  • Processor - Represents a processor with task list and total active time
  • List - Custom list implementation for storing tasks

Algorithm:

  1. Reads processor count and task list from input file
  2. Assigns tasks to processors using greedy approach
  3. Always assigns next task to processor with minimum current load
  4. Calculates and reports the makespan (maximum processor load)

Key Files:

  • Greedy.java - Main algorithm implementation
  • MaxPQ.java - Priority queue for processor scheduling
  • Task.java / Processor.java - Core data models
  • List.java - List implementation with insert/remove operations
  • Sort.java - Sorting utilities
  • Comparable.java - Custom comparable interface

Assignment 3: Advanced Topics (assignment3/)

Contains documentation, specifications, and implementation screenshots for the third assignment including:

  • Assignment specification documents (PDF, DOCX)
  • Implementation screenshots demonstrating functionality
  • Submission archives

Technologies Used

  • Language: Java
  • Concepts:
    • Generic data structures
    • Stack and Queue ADTs
    • Priority Queues
    • Greedy algorithms
    • File I/O
    • Exception handling

Building and Running

Assignment 1 - Stack/Queue Testing:

cd assignment1
javac *.java
java Main

Assignment 1 - HTML Tag Matching:

cd assignment1
javac Tagmatching.java StringStack*.java Node.java
java TagMatching

Assignment 2 - Task Scheduling:

cd assignment2
javac *.java
java Greedy <input_file>

Example:

java Greedy input.txt

Input Format (Assignment 2)

The task scheduling program expects input files with the following format:

<number_of_processors>
<number_of_tasks>
<task_id> <execution_time>
<task_id> <execution_time>
...

Key Learning Outcomes

  • Implementation of generic data structures in Java
  • Understanding of stack and queue operations and applications
  • Priority queue implementation and usage
  • Greedy algorithm design and analysis
  • Load balancing and task scheduling problems
  • File parsing and error handling

Additional Resources (etc/)

The etc folder contains:

  • Alternative implementations and early versions
  • Eclipse project settings and build artifacts
  • Assignment specifications and requirements documents
  • Original archive files

Author

Ioannis Tsintzos - AUEB Student

License

Educational project for academic purposes.

About

Implementations of fundamental data structures and algorithms

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages