Skip to content

Implementation of Java's most famous algorithms, including sorting (QuickSort, MergeSort), searching (Binary Search), and graph traversal (DFS, BFS). Each algorithm is optimized for performance, explained with examples, and designed to showcase core Java capabilities in solving computational problems.

Notifications You must be signed in to change notification settings

jerry-felipe/JavaCleanCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Java Famous Algorithms Collection

This repository contains implementations of some of the most famous and widely-used algorithms in Java. Each algorithm is designed to demonstrate efficiency, clarity, and practical application, complete with examples and explanations.

Algorithms Included

Sorting Algorithms

  • QuickSort: A divide-and-conquer algorithm that efficiently sorts data by partitioning.
  • MergeSort: A stable, recursive sorting algorithm ideal for large datasets.
  • BubbleSort: A simple sorting algorithm for small datasets.

Searching Algorithms

  • Binary Search: Fast searching in sorted arrays with O(log n) complexity.
  • Linear Search: A straightforward search method for unsorted datasets.

Graph Traversal Algorithms

  • Depth-First Search (DFS): Explores as far as possible along a branch before backtracking.
  • Breadth-First Search (BFS): Explores all neighbors at the present depth before moving deeper.

Features

  • 🛠 Well-documented code: Clear comments and step-by-step explanations.
  • 🚀 Optimized implementations: Focused on performance and readability.
  • 📚 Usage examples: Real-world scenarios and test cases for each algorithm.

Getting Started

Prerequisites

  • Java Development Kit (JDK 17 or higher)
  • A code editor or IDE (e.g., IntelliJ IDEA, Eclipse)

Setup

  1. Clone the repository: '''bash git clone https://github.com/jerry-felipe/java-famous-algorithms.git cd java-famous-algorithms '''

  2. Open the project in your favorite IDE.

  3. Run the desired algorithm:

    • Navigate to the 'src/' folder.
    • Execute the example files to see the algorithm in action.

Usage

  1. Explore the 'src/' folder for individual algorithm implementations.
  2. Modify input arrays or graphs in the example files to test with custom data.
  3. Run the examples: '''bash javac src/QuickSortExample.java java src/QuickSortExample '''

Contributing

Contributions are welcome!
To contribute:

  1. Fork the repository.
  2. Create a feature branch:
    '''bash git checkout -b feature/new-algorithm '''
  3. Commit your changes:
    '''bash git commit -m "Add a new algorithm implementation" '''
  4. Push the branch:
    '''bash git push origin feature/new-algorithm '''
  5. Open a pull request.

License

This project is licensed under the MIT License. See the 'LICENSE' file for details.


Contact

For questions or feedback, feel free to reach out:

About

Implementation of Java's most famous algorithms, including sorting (QuickSort, MergeSort), searching (Binary Search), and graph traversal (DFS, BFS). Each algorithm is optimized for performance, explained with examples, and designed to showcase core Java capabilities in solving computational problems.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published