Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tcrouch/multiset.cr
Multiset (bag) implementation in Crystal
https://github.com/tcrouch/multiset.cr
bag crystal data-structures multiset set
Last synced: about 2 months ago
JSON representation
Multiset (bag) implementation in Crystal
- Host: GitHub
- URL: https://github.com/tcrouch/multiset.cr
- Owner: tcrouch
- License: mit
- Created: 2016-03-09T22:56:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T16:50:14.000Z (over 1 year ago)
- Last Synced: 2024-02-01T15:49:41.060Z (5 months ago)
- Topics: bag, crystal, data-structures, multiset, set
- Language: Crystal
- Homepage:
- Size: 73.2 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-crystal - multiset.cr - Implementation of a multiset (Algorithms and Data structures)
- awesome-crystal - multiset.cr - Implementation of a multiset (Algorithms and Data structures)
- awesome-crystal - multiset.cr - Implementation of a multiset (Algorithms and Data structures)
README
# multiset
[![CI](https://github.com/tcrouch/multiset.cr/actions/workflows/ci.yml/badge.svg)](https://github.com/tcrouch/multiset.cr/actions/workflows/ci.yml)
[![Documentation](https://img.shields.io/badge/api-docs-informational)](https://tcrouch.github.io/multiset.cr)A multiset (bag) implementation in Crystal.
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
multiset:
github: tcrouch/multiset.cr
```## Usage
```crystal
require "multiset"ms1 = Multiset{1, 1}
ms1 << 2 # => Multiset{1, 1, 2}
ms1.merge [3, 4] # => Multiset{1, 1, 2, 3, 4}
ms2 = Multiset.new [2, 3, 4]
ms2.subset_of?(ms1) # => true
ms1 & ms2 # => Multiset{2, 3, 4}
```## Development
`crystal spec`
## Contributing
1. [Fork it](https://github.com/tcrouch/multiset.cr/fork)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## Contributors
- [[tcrouch]](https://github.com/tcrouch) Tom Crouch - creator, maintainer