This is an exercise to better understand collection data structures, particularly lists.
- Fork the repo
- Clone to your local machine
- Run
bundle install
to set up dependencies
Run the test suite with rspec spec/list_spec.rb
. There is a skeleton List
class under lib/list.rb
. Make the necessary change to that file to get the
test suite to pass. Once you do you'll have implemented your own rudimentary
linked list!
Don't use any of the collection data structures from Ruby. That means no
Array
, Hash
, Set
, etc. The goal here is to make your own from scratch.
Feel free to use all the fancy Ruby tricks you want. You can add more methods to
List
, introduce other supporting objects, or even go wild with
metaprogramming. The goal here is to explore what you can do with just raw Ruby
at your disposal.