Skip to content

A1LENT1337/assignment2-shellsort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Assignment 2 β€” Shell Sort Implementation and Analysis

πŸ“˜ Overview

This project is part of the Algorithmic Analysis and Peer Code Review assignment.
It implements Shell Sort with three gap sequences:

  • Shell's original sequence (n/2, n/4, ..., 1)
  • Knuth's sequence ((3^k - 1) / 2)
  • Sedgewick's sequence (4^k + 3*2^(k-1) + 1)

The implementation tracks performance metrics (comparisons, assignments, swaps) and provides a CLI tool for benchmarking.


🧩 Project Structure

assignment2-shellsort/
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ main/java/
β”‚ β”‚ β”œβ”€β”€ algorithms/ShellSort.java
β”‚ β”‚ β”œβ”€β”€ metrics/PerformanceTracker.java
β”‚ β”‚ └── cli/BenchmarkRunner.java
β”‚ └── test/java/algorithms/ShellSortTest.java
β”œβ”€β”€ docs/
β”‚ β”œβ”€β”€ analysis-report.pdf
β”‚ └── performance/results.csv
β”œβ”€β”€ pom.xml
└── README.mdassignment2-shellsort/
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ main/java/
β”‚ β”‚ β”œβ”€β”€ algorithms/ShellSort.java
β”‚ β”‚ β”œβ”€β”€ metrics/PerformanceTracker.java
β”‚ β”‚ └── cli/BenchmarkRunner.java
β”‚ └── test/java/algorithms/ShellSortTest.java
β”œβ”€β”€ docs/
β”‚ β”œβ”€β”€ analysis-report.pdf
β”‚ └── performance/results.csv
β”œβ”€β”€ pom.xml
└── README.md

βš™οΈ Build and Run

🧱 Compile the project

mvn compile

πŸ§ͺ Run unit tests mvn test πŸš€ Run benchmark java -cp target/classes cli.BenchmarkRunner 10000 random knuth

The results (time, comparisons, assignments) will be printed in console and saved to docs/performance/results.csv.

πŸ“Š Report The detailed algorithmic analysis and performance report can be found here: πŸ“„ docs/analysis-report.pdf

Author Nurdaulet Aitynbek

About

Assignment 2

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages