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

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

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

algorithm scala

Last synced: 6 months ago
JSON representation

A collection of algorithms implemented in Scala for practicing.

Awesome Lists containing this project

README

          

Algorithms with Scala

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




## πŸ“š Overview

This repository contains various algorithm implementations in Scala, covering topics such as:
- **Dynamic Programming** (e.g., Coin Change, Knapsack)
- **Sorting Algorithms** (e.g., QuickSort)
- **String Manipulation** (e.g., Longest Palindrome)
- **Mathematical Computation** (e.g., Number to Words)
- **Array and Search Algorithms** (e.g., Max Subarray Sum, Median Search)

## πŸ‚ Folder Structure

The project contains the following files:

```plaintext
β”œβ”€β”€ CoinChange.scala
β”œβ”€β”€ Knapsack.scala
β”œβ”€β”€ LongestPalindrome.scala
β”œβ”€β”€ LongestPalindromeSubsequence.scala
β”œβ”€β”€ MaxSubArraySum.scala
β”œβ”€β”€ MaxValue.scala
β”œβ”€β”€ MedianSearch.scala
β”œβ”€β”€ NumberToWords.scala
β”œβ”€β”€ QuickSort.scala
β”œβ”€β”€ Teams.scala
β”œβ”€β”€ TwoSum.scala
β”œβ”€β”€ LICENSE
└── README.md
```

## πŸš€ Getting Started

### Prerequisites
- Install [Scala](https://www.scala-lang.org/download/)
- Install [sbt](https://www.scala-sbt.org/download.html) (optional for project management)

### Running an Algorithm

To compile and run a specific Scala file, use:

```sh
scalac .scala # Compile the file
scala # Run the compiled file
```

For example:
```sh
scalac QuickSort.scala
scala QuickSort
```

## πŸ“Œ Algorithms List

| Algorithm | Description |
|-----------|------------|
| Coin Change | Finds the minimum number of coins needed for a given amount. |
| Knapsack | Solves the 0/1 knapsack problem using dynamic programming. |
| Longest Palindrome | Finds the longest palindromic substring in a given string. |
| Longest Palindromic Subsequence | Finds the longest palindromic subsequence using DP. |
| Max Subarray Sum | Implements Kadane’s algorithm to find the maximum sum subarray. |
| QuickSort | Implements the QuickSort sorting algorithm. |
| Number to Words | Converts numbers into words. |
| Two Sum | Finds two numbers that sum up to a target value. |

## πŸ“ License

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

## πŸ™Œ Contributing

Contributions are welcome! If you have new algorithms to add or improvements to existing code, feel free to open an issue or submit a pull request.

## ⭐ Acknowledgments

If you found this repository helpful, consider giving it a star ⭐ to show your support!

---
Happy Coding! πŸš€