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.
- Host: GitHub
- URL: https://github.com/phrugsa-limbunlom/algos
- Owner: phrugsa-limbunlom
- License: mit
- Created: 2022-11-09T19:49:49.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-12T23:37:59.000Z (10 months ago)
- Last Synced: 2025-03-21T19:45:12.068Z (9 months ago)
- Topics: algorithm, scala
- Language: Scala
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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! π