Skip to content

DvirUliel/Advanced-Java-Algorithm-Model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Java Advanced Project – Subarray Analysis System

πŸ“¦ Part A: Algorithm Library (AlgorithmModule)

This module provides a reusable Java library for analyzing numeric sequences (e.g., stock price changes) using the Subarray Sum family of algorithms.

βœ… Features:

  • Interface ISubarrayAnalyzer defines the strategy for subarray analysis.

  • Abstract class AbstractSubarrayAnalyzer implements shared logic.

  • Two concrete algorithms:

    • KadaneAnalyzer: finds subarray with maximum sum (profit).
    • PrefixSumAnalyzer: finds the longest subarray with a given target sum (e.g., 0 for zero return).
  • Output model: SubarrayResult (start index, end index, total sum).

πŸ§ͺ Includes:

  • Unit tests (JUnit 4) verifying correctness of each algorithm under edge cases and realistic input.

πŸ“ Folder structure:

src/
β”œβ”€β”€ AlgorithmModule/
β”‚   β”œβ”€β”€ AbstractSubarrayAnalyzer.java
β”‚   β”œβ”€β”€ ISubarrayAnalyzer.java
β”‚   β”œβ”€β”€ KadaneAnalyzer.java
β”‚   β”œβ”€β”€ PrefixSumAnalyzer.java
β”‚   └── SubarrayResult.java
└── test/
    └── ISubarrayAnalyzerTest.java

Β© Developed as part of Java Advanced Course – Final Project

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages