Skip to content

Latest commit

 

History

History
80 lines (64 loc) · 3.28 KB

README.md

File metadata and controls

80 lines (64 loc) · 3.28 KB

Design and Analysis of Algorithms in Java

Table of Contents

Introduction

This project is an implementation of various classical algorithms in Java, including sorting, searching, and graph algorithms. It focuses on both the correctness and performance analysis of algorithms, showcasing the time and space complexities. The project is useful for educational purposes, helping students and developers understand how different algorithms function and their performance characteristics.

Objectives

  • Implement classical algorithms for sorting, searching, and graph traversal.
  • Provide a platform to analyze time and space complexities.
  • Demonstrate algorithmic design paradigms such as Divide and Conquer, Greedy algorithms, and Dynamic Programming.

Features

  • Modular Java code for a wide range of algorithms.
  • Detailed performance and complexity analysis.
  • Easy-to-use interface to test algorithms with custom inputs.

Technologies Used

  • Programming Language: Java
  • IDE: IntelliJ IDEA / Eclipse / NetBeans (or any Java-compatible IDE)
  • Testing: JUnit (for unit testing algorithms)
  • Build Tool: Maven / Gradle (optional)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/algorithm-analysis-java.git
  2. Open the project in your preferred Java IDE (IntelliJ IDEA, Eclipse, etc.).

  3. Compile and run the project:

    • If using Maven:
      mvn clean install
      mvn exec:java
    • If using an IDE, locate Main.java and run it.

Usage

  1. Open the Main.java file to choose which algorithm to execute.
  2. You can call individual algorithms from the main file to run specific operations like sorting, searching, or solving graph problems.
  3. Test different input sizes to observe time complexity behaviors.

Algorithms Implemented

Sorting Algorithms

  • Bubble Sort: Implementation in Buble_Sort.java
  • Merge Sort: Implementation in MergeSort.java
  • Quick Sort: Implementation in QuickSort.java
  • Selection Sort: Implementation in Selection_Sort.java

Searching Algorithms

  • Binary Search (Iterative): Implementation in binary_search.java
  • Binary Search (Recursive): Implementation in binary_search_recursive.java

Graph Algorithms

  • Floyd-Warshall Algorithm: Implementation in floyds.java
  • Warshall’s Algorithm: Implementation in warshall.java
  • Prim’s Algorithm: Implementation in Prims.java
  • Kruskal’s Algorithm: Implementation in kruskal.java
  • Topological Sort: Implementation in Topological_Sort.java and TopologicalSort.java

Dynamic Programming

  • Knapsack Problem: Implementation in knap.java and Knapsack.java
  • Coin Change Problem: Implementation in CoinChange.java

Miscellaneous

  • Min-Max Algorithm: Implementation in MinMax.java

Contributing

Contributions are welcome! If you would like to add more algorithms, optimize the existing ones, or improve the project structure, feel free to fork the repository and create a pull request.