Sha256: d26aae76a735994c8f0d0005e7adb668044fa1681936292ea5266f92a57e21ee

Contents?: true

Size: 1.43 KB

Versions: 1

Compression:

Stored size: 1.43 KB

Contents

# RubyCollections

Welcome to ruby_collections gem. This gem will provide you with an easy access to common data structures to be used in ruby language.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'ruby_collections'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install ruby_collections

## Usage

Supported Data Structures: Max Heap, Min Heap

### RubyCollections::MaxHeap

```ruby

max_heap = RubyCollections::MaxHeap.new

max_heap.insert(1)

max_heap.insert(4)

max_heap.heap # => [nil, 1, 4]

max_heap.max # => 4

max_heap.extract_max # => 4

max_heap.max # => 1

```

Similarly we can use MinHeap as well.

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

1. Fork it ( https://github.com/[my-github-username]/ruby_collections/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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby_collections-0.0.2 README.md