An open API service indexing awesome lists of open source software.

https://github.com/phrugsa-limbunlom/algoj

A collection of algorithms implemented in Java for practicing.
https://github.com/phrugsa-limbunlom/algoj

algorithm java

Last synced: 4 months ago
JSON representation

A collection of algorithms implemented in Java for practicing.

Awesome Lists containing this project

README

          

Algorithms with Java

A collection of algorithms implemented in Java for practicing and learning.

## 📚 Overview

This repository contains various algorithm implementations in Java, covering topics such as:
- **Mathematical Computations** (e.g., Difference of Sum, GCD, Find Exponent)
- **String Manipulation** (e.g., Replace Character, Palindrome Check)
- **Array and Search Algorithms** (e.g., Trapping Water, Median Search)
- **Binary Tree Algorithms** (e.g., Depth and traversal operations)

## 🐂 Folder Structure

The project contains the following structure:

```plaintext
src/main/java/
├── binaryTree/
│ ├── BinaryTreeAlgorithms.java
├── DifferenceOfSumApp.java
├── DigitApp.java
├── FindExponentApp.java
├── GcdApp.java
├── LargeSmallSumApp.java
├── MedianSearchApp.java
├── NumberOfCarriesApp.java
├── PalindromeApp.java
├── ProductPairApp.java
├── ReplaceCharApp.java
├── SequenceApp.java
├── TrappingWaterApp.java
├── LICENSE
└── README.md
```

## 🚀 Getting Started

### Prerequisites
- Install [Java JDK](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html)
- Install [Gradle](https://gradle.org/install/) (Optional for project management)

### Running an Algorithm

To compile and run a specific Java file, use:

```sh
javac .java # Compile the file
java # Run the compiled file
```

For example:
```sh
javac GcdApp.java
java GcdApp
```

## 📌 Algorithms List

| Algorithm | Description |
|-----------|------------|
| Difference of Sum | Calculates the difference between sum of squares and square of sum. |
| GCD | Finds the greatest common divisor of two numbers. |
| Find Exponent | Computes power of a number efficiently. |
| Palindrome | Checks if a string or number is a palindrome. |
| Median Search | Finds the median in a given list of numbers. |
| Trapping Water | Solves the trapping rain water problem. |

## 📝 License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

## 🙌 Contributing

Contributions are welcome! Feel free to submit a pull request with any new algorithms or improvements.

## ⭐ Acknowledgments

If you found this repository useful, consider giving it a star ⭐ to support the project!

---
Happy Coding! 🚀