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.
- 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.
- Binary Search: Fast searching in sorted arrays with O(log n) complexity.
- Linear Search: A straightforward search method for unsorted datasets.
- 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.
- 🛠 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.
- Java Development Kit (JDK 17 or higher)
- A code editor or IDE (e.g., IntelliJ IDEA, Eclipse)
-
Clone the repository: '''bash git clone https://github.com/jerry-felipe/java-famous-algorithms.git cd java-famous-algorithms '''
-
Open the project in your favorite IDE.
-
Run the desired algorithm:
- Navigate to the 'src/' folder.
- Execute the example files to see the algorithm in action.
- Explore the 'src/' folder for individual algorithm implementations.
- Modify input arrays or graphs in the example files to test with custom data.
- Run the examples: '''bash javac src/QuickSortExample.java java src/QuickSortExample '''
Contributions are welcome!
To contribute:
- Fork the repository.
- Create a feature branch:
'''bash git checkout -b feature/new-algorithm ''' - Commit your changes:
'''bash git commit -m "Add a new algorithm implementation" ''' - Push the branch:
'''bash git push origin feature/new-algorithm ''' - Open a pull request.
This project is licensed under the MIT License. See the 'LICENSE' file for details.
For questions or feedback, feel free to reach out:
- GitHub Issues: https://github.com/jerry-felipe/java-famous-algorithms/issues
- Email: [email protected]