https://github.com/rossta/singly_linked_list.rb
A singly linked list exercise in Ruby
https://github.com/rossta/singly_linked_list.rb
Last synced: about 1 year ago
JSON representation
A singly linked list exercise in Ruby
- Host: GitHub
- URL: https://github.com/rossta/singly_linked_list.rb
- Owner: rossta
- License: mit
- Created: 2015-12-24T16:59:24.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-29T05:08:24.000Z (over 10 years ago)
- Last Synced: 2025-02-15T10:57:02.816Z (about 1 year ago)
- Language: Ruby
- Size: 17.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# LinkedList
A singly linked list exercise in Ruby
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'singly_linked_list'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install singly_linked_list
## Usage
Initialize the list:
```ruby
list = LinkedList.new
```
Push data to the list:
```ruby
list << 1
list << 2
list << 3
```
Retrieve head, tail nodes from the list
```ruby
list.head #=> #>
list.tail #=> #
```
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also 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`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/rossta/singly_linked_list.rb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).